Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3526300
D12319.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
D12319.diff
View Options
diff --git a/lib/handlers/user-infos-handler.react.js b/lib/handlers/user-infos-handler.react.js
--- a/lib/handlers/user-infos-handler.react.js
+++ b/lib/handlers/user-infos-handler.react.js
@@ -2,13 +2,19 @@
import * as React from 'react';
+import {
+ updateRelationships,
+ updateRelationshipsActionTypes,
+} from '../actions/relationship-actions.js';
import {
useFindUserIdentities,
findUserIdentitiesActionTypes,
} from '../actions/user-actions.js';
import { useGetAndUpdateDeviceListsForUsers } from '../hooks/peer-list-hooks.js';
+import { useLegacyAshoatKeyserverCall } from '../keyserver-conn/legacy-keyserver-call.js';
import { usersWithMissingDeviceListSelector } from '../selectors/user-selectors.js';
import { useTunnelbroker } from '../tunnelbroker/tunnelbroker-context.js';
+import { relationshipActions } from '../types/relationship-types.js';
import { getMessageForException } from '../utils/errors.js';
import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -32,6 +38,9 @@
const requestedIDsRef = React.useRef(new Set<string>());
+ const callUpdateRelationships =
+ useLegacyAshoatKeyserverCall(updateRelationships);
+
React.useEffect(() => {
const newUserIDs = Object.keys(userInfosWithMissingUsernames).filter(
id => !requestedIDsRef.current.has(id),
@@ -39,16 +48,10 @@
if (!usingCommServicesAccessToken || newUserIDs.length === 0) {
return;
}
-
+ // 1. Fetch usernames from identity
const promise = (async () => {
newUserIDs.forEach(id => requestedIDsRef.current.add(id));
- // 1. Fetch usernames from identity
const identities = await findUserIdentities(newUserIDs);
-
- // 2. Fetch avatars and settings from auth keyserver
- if (relyingOnAuthoritativeKeyserver) {
- // TODO
- }
newUserIDs.forEach(id => requestedIDsRef.current.delete(id));
const newUserInfos = [];
@@ -61,7 +64,18 @@
return { userInfos: newUserInfos };
})();
void dispatchActionPromise(findUserIdentitiesActionTypes, promise);
+ // 2. Fetch avatars from auth keyserver
+ if (relyingOnAuthoritativeKeyserver) {
+ void dispatchActionPromise(
+ updateRelationshipsActionTypes,
+ callUpdateRelationships({
+ action: relationshipActions.ACKNOWLEDGE,
+ userIDs: newUserIDs,
+ }),
+ );
+ }
}, [
+ callUpdateRelationships,
dispatchActionPromise,
findUserIdentities,
userInfos,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 9:29 PM (8 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701043
Default Alt Text
D12319.diff (2 KB)
Attached To
Mode
D12319: [lib] Fetch user avatars for new user ids
Attached
Detach File
Event Timeline
Log In to Comment