Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32562397
D7657.1767338308.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D7657.1767338308.diff
View Options
diff --git a/keyserver/src/creators/account-creator.js b/keyserver/src/creators/account-creator.js
--- a/keyserver/src/creators/account-creator.js
+++ b/keyserver/src/creators/account-creator.js
@@ -32,6 +32,7 @@
import createIDs from './id-creator.js';
import createMessages from './message-creator.js';
+import { createOlmSession } from './olm-session-creator.js';
import {
createThread,
createPrivateThread,
@@ -81,7 +82,11 @@
WHERE LCASE(username) = LCASE(${request.username})
`;
const promises = [dbQuery(usernameQuery)];
- const { calendarQuery, signedIdentityKeysBlob } = request;
+ const {
+ calendarQuery,
+ signedIdentityKeysBlob,
+ initialNotificationsEncryptedMessage,
+ } = request;
if (calendarQuery) {
promises.push(verifyCalendarQueryThreadIDs(calendarQuery));
}
@@ -124,6 +129,13 @@
]);
viewer.setNewCookie(userViewerData);
+ if (userViewerData.cookieID && initialNotificationsEncryptedMessage) {
+ await createOlmSession(
+ initialNotificationsEncryptedMessage,
+ 'notifications',
+ userViewerData.cookieID,
+ );
+ }
if (calendarQuery) {
await setNewSession(viewer, calendarQuery, 0);
}
diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js
--- a/keyserver/src/responders/user-responders.js
+++ b/keyserver/src/responders/user-responders.js
@@ -215,6 +215,7 @@
// old clients, but we no longer do anything with it.
primaryIdentityPublicKey: t.maybe(tRegex(primaryIdentityPublicKeyRegex)),
signedIdentityKeysBlob: t.maybe(signedIdentityKeysBlobValidator),
+ initialNotificationsEncryptedMessage: t.maybe(t.String),
});
async function accountCreationResponder(
diff --git a/lib/types/account-types.js b/lib/types/account-types.js
--- a/lib/types/account-types.js
+++ b/lib/types/account-types.js
@@ -53,6 +53,7 @@
+deviceTokenUpdateRequest?: ?DeviceTokenUpdateRequest,
+platformDetails: PlatformDetails,
+signedIdentityKeysBlob?: SignedIdentityKeysBlob,
+ +initialNotificationsEncryptedMessage?: string,
};
export type RegisterResponse = {
diff --git a/native/account/register-panel.react.js b/native/account/register-panel.react.js
--- a/native/account/register-panel.react.js
+++ b/native/account/register-panel.react.js
@@ -37,6 +37,7 @@
import { useSelector } from '../redux/redux-utils.js';
import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js';
import type { KeyPressEvent } from '../types/react-native.js';
+import { useInitialNotificationsEncryptedMessage } from '../utils/crypto-utils.js';
import { type StateContainer } from '../utils/state-container.js';
export type RegisterState = {
@@ -55,6 +56,9 @@
+logInExtraInfo: () => Promise<LogInExtraInfo>,
+dispatchActionPromise: DispatchActionPromise,
+register: (registerInfo: RegisterInfo) => Promise<RegisterResult>,
+ +initialNotificationsEncryptedMessage: (
+ oneTimeKeysCount: number,
+ ) => Promise<string>,
};
type State = {
+confirmPasswordFocused: boolean,
@@ -289,9 +293,14 @@
} else {
Keyboard.dismiss();
const extraInfo = await this.props.logInExtraInfo();
+ const initialNotificationsEncryptedMessage =
+ await this.props.initialNotificationsEncryptedMessage(1);
this.props.dispatchActionPromise(
registerActionTypes,
- this.registerAction(extraInfo),
+ this.registerAction({
+ ...extraInfo,
+ initialNotificationsEncryptedMessage,
+ }),
undefined,
({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),
);
@@ -457,6 +466,8 @@
const dispatchActionPromise = useDispatchActionPromise();
const callRegister = useServerCall(register);
+ const callInitialNotificationsEncryptedMessage =
+ useInitialNotificationsEncryptedMessage();
return (
<RegisterPanel
@@ -465,6 +476,9 @@
logInExtraInfo={logInExtraInfo}
dispatchActionPromise={dispatchActionPromise}
register={callRegister}
+ initialNotificationsEncryptedMessage={
+ callInitialNotificationsEncryptedMessage
+ }
/>
);
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 2, 7:18 AM (5 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5878659
Default Alt Text
D7657.1767338308.diff (4 KB)
Attached To
Mode
D7657: Establish olm notifs session on both sides during registration
Attached
Detach File
Event Timeline
Log In to Comment