Page MenuHomePhabricator

D12217.diff
No OneTemporary

D12217.diff

diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -44,7 +44,10 @@
UpdateUserAvatarResponse,
} from '../types/avatar-types.js';
import type { RawEntryInfo, CalendarQuery } from '../types/entry-types.js';
-import type { IdentityAuthResult } from '../types/identity-service-types.js';
+import type {
+ Identities,
+ IdentityAuthResult,
+} from '../types/identity-service-types';
import type {
RawMessageInfo,
MessageTruncationStatuses,
@@ -1006,6 +1009,21 @@
const processNewUserIDsActionType = 'PROCESS_NEW_USER_IDS';
+const findUserIdentitiesActionTypes = Object.freeze({
+ started: 'FIND_USER_IDENTITIES_STARTED',
+ success: 'FIND_USER_IDENTITIES_SUCCESS',
+ failed: 'FIND_USER_IDENTITIES_FAILED',
+});
+
+function useFindUserIdentities(): (
+ userIDs: $ReadOnlyArray<string>,
+) => Promise<Identities> {
+ const client = React.useContext(IdentityClientContext);
+ const identityClient = client?.identityClient;
+ invariant(identityClient, 'Identity client should be set');
+ return identityClient.findUserIdentities;
+}
+
export {
changeKeyserverUserPasswordActionTypes,
changeKeyserverUserPassword,
@@ -1052,4 +1070,6 @@
identityGenerateNonceActionTypes,
useIdentityGenerateNonce,
processNewUserIDsActionType,
+ findUserIdentitiesActionTypes,
+ useFindUserIdentities,
};
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
@@ -58,7 +58,7 @@
CalendarThreadFilter,
SetCalendarDeletedFilterPayload,
} from './filter-types.js';
-import type { IdentityAuthResult } from './identity-service-types.js';
+import type { IdentityAuthResult } from './identity-service-types';
import type { IntegrityStore } from './integrity-types.js';
import type {
KeyserverStore,
@@ -141,7 +141,12 @@
RoleDeletionPayload,
} from './thread-types.js';
import type { ClientUpdatesResultWithUserInfos } from './update-types.js';
-import type { CurrentUserInfo, UserInfos, UserStore } from './user-types.js';
+import type {
+ CurrentUserInfo,
+ UserInfos,
+ UserStore,
+ UserInfo,
+} from './user-types.js';
import type { SetDeviceTokenActionPayload } from '../actions/device-actions.js';
import type {
UpdateConnectionStatusPayload,
@@ -1448,6 +1453,24 @@
+userIDs: $ReadOnlyArray<string>,
},
+loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'FIND_USER_IDENTITIES_STARTED',
+ +loadingInfo?: LoadingInfo,
+ +payload?: void,
+ }
+ | {
+ +type: 'FIND_USER_IDENTITIES_SUCCESS',
+ +payload: {
+ +userInfos: $ReadOnlyArray<UserInfo>,
+ },
+ +loadingInfo: LoadingInfo,
+ }
+ | {
+ +type: 'FIND_USER_IDENTITIES_FAILED',
+ +error: true,
+ +payload: Error,
+ +loadingInfo: LoadingInfo,
},
}>;

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 6:29 PM (18 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682283
Default Alt Text
D12217.diff (2 KB)

Event Timeline