Page MenuHomePhabricator

D7728.id26120.diff
No OneTemporary

D7728.id26120.diff

diff --git a/lib/actions/link-actions.js b/lib/actions/link-actions.js
--- a/lib/actions/link-actions.js
+++ b/lib/actions/link-actions.js
@@ -1,6 +1,7 @@
// @flow
import type {
+ FetchInviteLinksResponse,
InviteLinkVerificationRequest,
InviteLinkVerificationResponse,
} from '../types/link-types.js';
@@ -30,4 +31,25 @@
};
};
-export { verifyInviteLinkActionTypes, verifyInviteLink };
+const fetchPrimaryInviteLinkActionTypes = Object.freeze({
+ started: 'FETCH_PRIMARY_INVITE_LINKS_STARTED',
+ success: 'FETCH_PRIMARY_INVITE_LINKS_SUCCESS',
+ failed: 'FETCH_PRIMARY_INVITE_LINKS_FAILED',
+});
+const fetchPrimaryInviteLinks =
+ (
+ callServerEndpoint: CallServerEndpoint,
+ ): (() => Promise<FetchInviteLinksResponse>) =>
+ async () => {
+ const response = await callServerEndpoint('fetch_primary_invite_links');
+ return {
+ links: response.links,
+ };
+ };
+
+export {
+ verifyInviteLinkActionTypes,
+ verifyInviteLink,
+ fetchPrimaryInviteLinkActionTypes,
+ fetchPrimaryInviteLinks,
+};
diff --git a/lib/types/endpoints.js b/lib/types/endpoints.js
--- a/lib/types/endpoints.js
+++ b/lib/types/endpoints.js
@@ -63,6 +63,7 @@
FETCH_ERROR_REPORT_INFOS: 'fetch_error_report_infos',
FETCH_MESSAGES: 'fetch_messages',
FETCH_PINNED_MESSAGES: 'fetch_pinned_messages',
+ FETCH_PRIMARY_INVITE_LINKS: 'fetch_primary_invite_links',
FETCH_THREAD_MEDIA: 'fetch_thread_media',
GET_SESSION_PUBLIC_KEYS: 'get_session_public_keys',
JOIN_THREAD: 'join_thread',
diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -36,7 +36,10 @@
SetCalendarDeletedFilterPayload,
} from './filter-types.js';
import type { LifecycleState } from './lifecycle-state-types.js';
-import type { InviteLinkVerificationResponse } from './link-types.js';
+import type {
+ FetchInviteLinksResponse,
+ InviteLinkVerificationResponse,
+} from './link-types.js';
import type { LoadingStatus, LoadingInfo } from './loading-types.js';
import type { UpdateMultimediaMessageMediaPayload } from './media-types.js';
import type { MessageReportCreationResult } from './message-report-types.js';
@@ -1008,6 +1011,22 @@
+error: true,
+payload: Error,
+loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'FETCH_PRIMARY_INVITE_LINKS_STARTED',
+ +loadingInfo?: LoadingInfo,
+ +payload?: void,
+ }
+ | {
+ +type: 'FETCH_PRIMARY_INVITE_LINKS_SUCCESS',
+ +payload: FetchInviteLinksResponse,
+ +loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'FETCH_PRIMARY_INVITE_LINKS_FAILED',
+ +error: true,
+ +payload: Error,
+ +loadingInfo: LoadingInfo,
};
export type ActionPayload = ?(Object | Array<*> | $ReadOnlyArray<*> | string);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 8:20 PM (21 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2586075
Default Alt Text
D7728.id26120.diff (2 KB)

Event Timeline