Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32558095
D10667.1767261579.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D10667.1767261579.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
@@ -6,6 +6,7 @@
import { logOutActionTypes, useLogOut } from '../actions/user-actions.js';
import { connectionSelector } from '../selectors/keyserver-selectors.js';
import { IdentityClientContext } from '../shared/identity-client-context.js';
+import { NotificationsSessionCreatorContext } from '../shared/notifications-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 +27,9 @@
const hasConnectionIssue = useSelector(
state => !!connectionSelector(keyserverID)(state)?.connectionIssue,
);
+ const cookie = useSelector(
+ state => state.keyserverStore.keyserverInfos[keyserverID].cookie,
+ );
React.useEffect(() => {
if (hasConnectionIssue) {
@@ -38,6 +42,14 @@
)?.identityClient;
invariant(identityClient, 'Identity client should be set');
+ const notificationsSessionCreatorContext = React.useContext(
+ NotificationsSessionCreatorContext,
+ );
+ invariant(
+ notificationsSessionCreatorContext,
+ 'Notifications session creator context should be set',
+ );
+
React.useEffect(() => {
if (!usingCommServicesAccessToken) {
return;
@@ -45,7 +57,19 @@
void (async () => {
try {
- await identityClient.getKeyserverKeys(keyserverID);
+ const keyserverKeys =
+ await identityClient.getKeyserverKeys(keyserverID);
+
+ if (!keyserverKeys) {
+ return;
+ }
+
+ await notificationsSessionCreatorContext.notificationsSessionCreator(
+ cookie,
+ keyserverKeys.identityKeysBlob.notificationIdentityPublicKeys,
+ keyserverKeys.notifInitializationInfo,
+ keyserverID,
+ );
} catch (e) {
console.log(
`Error getting keys for keyserver with id ${keyserverID}`,
@@ -53,7 +77,7 @@
);
}
})();
- }, [keyserverID, identityClient]);
+ }, [keyserverID, identityClient, notificationsSessionCreatorContext, cookie]);
if (keyserverID !== ashoatKeyserverID) {
return null;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 1, 9:59 AM (14 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5875701
Default Alt Text
D10667.1767261579.diff (2 KB)
Attached To
Mode
D10667: [lib] Create notifs Olm session
Attached
Detach File
Event Timeline
Log In to Comment