Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3497219
D12217.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12217.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12217: [lib] Add useFindUserIdentities
Attached
Detach File
Event Timeline
Log In to Comment