diff --git a/lib/selectors/socket-selectors.js b/lib/selectors/socket-selectors.js --- a/lib/selectors/socket-selectors.js +++ b/lib/selectors/socket-selectors.js @@ -9,6 +9,7 @@ filterRawEntryInfosByCalendarQuery, } from '../shared/entry-utils.js'; import threadWatcher from '../shared/thread-watcher.js'; +import type { SignedIdentityKeysBlob } from '../types/crypto-types.js'; import type { RawEntryInfo, CalendarQuery } from '../types/entry-types.js'; import type { AppState } from '../types/redux-types.js'; import type { ClientReportCreationRequest } from '../types/report-types.js'; @@ -39,6 +40,7 @@ ) => ( calendarActive: boolean, oneTimeKeyGenerator: ?OneTimeKeyGenerator, + getSignedIdentityKeysBlob: ?() => SignedIdentityKeysBlob, serverRequests: $ReadOnlyArray, ) => $ReadOnlyArray = createSelector( (state: AppState) => state.threadStore.threadInfos, @@ -56,6 +58,7 @@ ( calendarActive: boolean, oneTimeKeyGenerator: ?OneTimeKeyGenerator, + getSignedIdentityKeysBlob: ?() => SignedIdentityKeysBlob, serverRequests: $ReadOnlyArray, ): $ReadOnlyArray => { const clientResponses = []; @@ -157,6 +160,15 @@ type: serverRequestTypes.MORE_ONE_TIME_KEYS, keys, }); + } else if ( + serverRequest.type === serverRequestTypes.SIGNED_IDENTITY_KEYS_BLOB && + getSignedIdentityKeysBlob + ) { + const signedIdentityKeysBlob = getSignedIdentityKeysBlob(); + clientResponses.push({ + type: serverRequestTypes.SIGNED_IDENTITY_KEYS_BLOB, + signedIdentityKeysBlob, + }); } } return clientResponses; diff --git a/native/selectors/socket-selectors.js b/native/selectors/socket-selectors.js --- a/native/selectors/socket-selectors.js +++ b/native/selectors/socket-selectors.js @@ -7,6 +7,7 @@ sessionStateFuncSelector, } from 'lib/selectors/socket-selectors.js'; import { createOpenSocketFunction } from 'lib/shared/socket-utils.js'; +import type { SignedIdentityKeysBlob } from 'lib/types/crypto-types.js'; import type { ClientServerRequest, ClientClientResponse, @@ -61,6 +62,7 @@ getClientResponsesFunc: ( calendarActive: boolean, oneTimeKeyGenerator: ?OneTimeKeyGenerator, + getSignedIdentityKeysBlob: ?() => SignedIdentityKeysBlob, serverRequests: $ReadOnlyArray, ) => $ReadOnlyArray, calendarActive: boolean, @@ -69,6 +71,7 @@ getClientResponsesFunc( calendarActive, oneTimeKeyGenerator, + null, serverRequests, ), ); diff --git a/web/selectors/socket-selectors.js b/web/selectors/socket-selectors.js --- a/web/selectors/socket-selectors.js +++ b/web/selectors/socket-selectors.js @@ -7,6 +7,7 @@ sessionStateFuncSelector, } from 'lib/selectors/socket-selectors.js'; import { createOpenSocketFunction } from 'lib/shared/socket-utils.js'; +import type { SignedIdentityKeysBlob } from 'lib/types/crypto-types.js'; import type { ClientServerRequest, ClientClientResponse, @@ -42,12 +43,13 @@ getClientResponsesFunc: ( calendarActive: boolean, oneTimeKeyGenerator: ?OneTimeKeyGenerator, + getSignedIdentityKeysBlob: ?() => SignedIdentityKeysBlob, serverRequests: $ReadOnlyArray, ) => $ReadOnlyArray, calendarActive: boolean, ) => (serverRequests: $ReadOnlyArray) => - getClientResponsesFunc(calendarActive, null, serverRequests), + getClientResponsesFunc(calendarActive, null, null, serverRequests), ); const webSessionStateFuncSelector: (state: AppState) => () => SessionState =