Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3158048
D10667.id35946.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
D10667.id35946.diff
View Options
diff --git a/lib/components/keyserver-connection-handler.js b/lib/components/keyserver-connection-handler.js
--- a/lib/components/keyserver-connection-handler.js
+++ b/lib/components/keyserver-connection-handler.js
@@ -4,8 +4,12 @@
import * as React from 'react';
import { logOutActionTypes, useLogOut } from '../actions/user-actions.js';
-import { connectionSelector } from '../selectors/keyserver-selectors.js';
+import {
+ connectionSelector,
+ cookieSelector,
+} from '../selectors/keyserver-selectors.js';
import { IdentityClientContext } from '../shared/identity-client-context.js';
+import { OlmSessionCreatorContext } from '../shared/olm-session-creator-context.js';
import type { BaseSocketProps } from '../socket/socket.react.js';
import { useDispatchActionPromise } from '../utils/redux-promise-utils.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -26,6 +30,7 @@
const hasConnectionIssue = useSelector(
state => !!connectionSelector(keyserverID)(state)?.connectionIssue,
);
+ const cookie = useSelector(cookieSelector(keyserverID));
React.useEffect(() => {
if (hasConnectionIssue) {
@@ -38,6 +43,9 @@
)?.identityClient;
invariant(identityClient, 'Identity client should be set');
+ const olmSessionCreator = React.useContext(OlmSessionCreatorContext);
+ invariant(olmSessionCreator, 'Olm session creator should be set');
+
React.useEffect(() => {
if (!usingCommServicesAccessToken) {
return;
@@ -45,7 +53,15 @@
void (async () => {
try {
- await identityClient.getKeyserverKeys(keyserverID);
+ const keyserverKeys =
+ await identityClient.getKeyserverKeys(keyserverID);
+
+ await olmSessionCreator.notificationsSessionCreator(
+ cookie,
+ keyserverKeys.identityKeysBlob.notificationIdentityPublicKeys,
+ keyserverKeys.notifInitializationInfo,
+ keyserverID,
+ );
} catch (e) {
console.log(
`Error getting keys for keyserver with id ${keyserverID}`,
@@ -53,7 +69,7 @@
);
}
})();
- }, [keyserverID, identityClient]);
+ }, [keyserverID, identityClient, olmSessionCreator, cookie]);
if (keyserverID !== ashoatKeyserverID) {
return null;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 9:27 PM (21 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2431814
Default Alt Text
D10667.id35946.diff (2 KB)
Attached To
Mode
D10667: [lib] Create notifs Olm session
Attached
Detach File
Event Timeline
Log In to Comment