Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3527473
D10751.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D10751.diff
View Options
diff --git a/lib/shared/notifications-session-creator-context.js b/lib/shared/olm-session-creator-context.js
rename from lib/shared/notifications-session-creator-context.js
rename to lib/shared/olm-session-creator-context.js
--- a/lib/shared/notifications-session-creator-context.js
+++ b/lib/shared/olm-session-creator-context.js
@@ -5,7 +5,7 @@
import type { OLMIdentityKeys } from '../types/crypto-types.js';
import type { OlmSessionInitializationInfo } from '../types/request-types.js';
-export type NotificationsSessionCreatorContextType = {
+export type OlmSessionCreatorContextType = {
+notificationsSessionCreator: (
cookie: ?string,
notificationsIdentityKeys: OLMIdentityKeys,
@@ -14,7 +14,7 @@
) => Promise<string>,
};
-const NotificationsSessionCreatorContext: React.Context<?NotificationsSessionCreatorContextType> =
+const OlmSessionCreatorContext: React.Context<?OlmSessionCreatorContextType> =
React.createContext(null);
-export { NotificationsSessionCreatorContext };
+export { OlmSessionCreatorContext };
diff --git a/native/account/account-hooks.js b/native/account/account-hooks.js
--- a/native/account/account-hooks.js
+++ b/native/account/account-hooks.js
@@ -2,7 +2,7 @@
import * as React from 'react';
-import { NotificationsSessionCreatorContext } from 'lib/shared/notifications-session-creator-context.js';
+import { OlmSessionCreatorContext } from 'lib/shared/olm-session-creator-context.js';
import type { OLMIdentityKeys } from 'lib/types/crypto-types.js';
import type { OlmSessionInitializationInfo } from 'lib/types/request-types.js';
@@ -29,13 +29,13 @@
notificationsSessionCreator,
};
-function NotificationsSessionCreatorProvider(props: Props): React.Node {
+function OlmSessionCreatorProvider(props: Props): React.Node {
const { children } = props;
return (
- <NotificationsSessionCreatorContext.Provider value={contextValue}>
+ <OlmSessionCreatorContext.Provider value={contextValue}>
{children}
- </NotificationsSessionCreatorContext.Provider>
+ </OlmSessionCreatorContext.Provider>
);
}
-export { NotificationsSessionCreatorProvider };
+export { OlmSessionCreatorProvider };
diff --git a/native/root.react.js b/native/root.react.js
--- a/native/root.react.js
+++ b/native/root.react.js
@@ -33,7 +33,7 @@
import { TunnelbrokerProvider } from 'lib/tunnelbroker/tunnelbroker-context.js';
import { actionLogger } from 'lib/utils/action-logger.js';
-import { NotificationsSessionCreatorProvider } from './account/account-hooks.js';
+import { OlmSessionCreatorProvider } from './account/account-hooks.js';
import { RegistrationContextProvider } from './account/registration/registration-context-provider.react.js';
import NativeEditThreadAvatarProvider from './avatars/native-edit-thread-avatar-provider.react.js';
import BackupHandler from './backup/backup-handler.js';
@@ -302,7 +302,7 @@
<CallKeyserverEndpointProvider>
<StaffContextProvider>
<IdentityServiceContextProvider>
- <NotificationsSessionCreatorProvider>
+ <OlmSessionCreatorProvider>
<TunnelbrokerProvider
initMessage={tunnelbrokerInitMessage}
peerToPeerMessageHandler={peerToPeerMessageHandler}
@@ -360,7 +360,7 @@
</NavContext.Provider>
</FeatureFlagsProvider>
</TunnelbrokerProvider>
- </NotificationsSessionCreatorProvider>
+ </OlmSessionCreatorProvider>
</IdentityServiceContextProvider>
</StaffContextProvider>
</CallKeyserverEndpointProvider>
diff --git a/web/account/account-hooks.js b/web/account/account-hooks.js
--- a/web/account/account-hooks.js
+++ b/web/account/account-hooks.js
@@ -11,7 +11,7 @@
getOneTimeKeyValuesFromBlob,
getPrekeyValueFromBlob,
} from 'lib/shared/crypto-utils.js';
-import { NotificationsSessionCreatorContext } from 'lib/shared/notifications-session-creator-context.js';
+import { OlmSessionCreatorContext } from 'lib/shared/olm-session-creator-context.js';
import type {
SignedIdentityKeysBlob,
CryptoStore,
@@ -174,7 +174,7 @@
}, [getOrCreateCryptoStore]);
}
-function NotificationsSessionCreatorProvider(props: Props): React.Node {
+function OlmSessionCreatorProvider(props: Props): React.Node {
const getOrCreateCryptoStore = useGetOrCreateCryptoStore();
const currentCryptoStore = useSelector(state => state.cryptoStore);
@@ -307,9 +307,9 @@
);
return (
- <NotificationsSessionCreatorContext.Provider value={contextValue}>
+ <OlmSessionCreatorContext.Provider value={contextValue}>
{props.children}
- </NotificationsSessionCreatorContext.Provider>
+ </OlmSessionCreatorContext.Provider>
);
}
@@ -319,7 +319,7 @@
notificationsInitializationInfo: OlmSessionInitializationInfo,
keyserverID: string,
) => Promise<string> {
- const context = React.useContext(NotificationsSessionCreatorContext);
+ const context = React.useContext(OlmSessionCreatorContext);
invariant(context, 'WebNotificationsSessionCreator not found.');
return context.notificationsSessionCreator;
@@ -328,7 +328,7 @@
export {
useGetSignedIdentityKeysBlob,
useGetOrCreateCryptoStore,
- NotificationsSessionCreatorProvider,
+ OlmSessionCreatorProvider,
useWebNotificationsSessionCreator,
GetOrCreateCryptoStoreProvider,
};
diff --git a/web/root.js b/web/root.js
--- a/web/root.js
+++ b/web/root.js
@@ -16,7 +16,7 @@
import {
GetOrCreateCryptoStoreProvider,
- NotificationsSessionCreatorProvider,
+ OlmSessionCreatorProvider,
} from './account/account-hooks.js';
import App from './app.react.js';
import { SQLiteDataHandler } from './database/sqlite-data-handler.js';
@@ -47,14 +47,14 @@
<InitialReduxStateGate persistor={persistor}>
<GetOrCreateCryptoStoreProvider>
<IdentityServiceContextProvider>
- <NotificationsSessionCreatorProvider>
+ <OlmSessionCreatorProvider>
<Router history={history.getHistoryObject()}>
<Route path="*" component={App} />
</Router>
<KeyserverConnectionsHandler socketComponent={Socket} />
<SQLiteDataHandler />
<IntegrityHandler />
- </NotificationsSessionCreatorProvider>
+ </OlmSessionCreatorProvider>
</IdentityServiceContextProvider>
</GetOrCreateCryptoStoreProvider>
</InitialReduxStateGate>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 5:13 AM (10 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701663
Default Alt Text
D10751.diff (6 KB)
Attached To
Mode
D10751: [lib] rename `NotificationsSessionCreatorContext` -> `OlmSessionCreatorContext`
Attached
Detach File
Event Timeline
Log In to Comment