diff --git a/protos/SignalStorage.proto b/protos/SignalStorage.proto index b5b9c5fb9..3dbe6b4c6 100644 --- a/protos/SignalStorage.proto +++ b/protos/SignalStorage.proto @@ -101,14 +101,22 @@ message GroupV1Record { } message GroupV2Record { - optional bytes masterKey = 1; - optional bool blocked = 2; - optional bool whitelisted = 3; - optional bool archived = 4; - optional bool markedUnread = 5; - optional uint64 mutedUntilTimestamp = 6; - optional bool dontNotifyForMentionsIfMuted = 7; - optional bool hideStory = 8; + enum StorySendMode { + DEFAULT = 0; + DISABLED = 1; + ENABLED = 2; + } + + optional bytes masterKey = 1; + optional bool blocked = 2; + optional bool whitelisted = 3; + optional bool archived = 4; + optional bool markedUnread = 5; + optional uint64 mutedUntilTimestamp = 6; + optional bool dontNotifyForMentionsIfMuted = 7; + optional bool hideStory = 8; + reserved /* storySendEnabled */ 9; // removed + optional StorySendMode storySendMode = 10; } message AccountRecord { diff --git a/ts/background.ts b/ts/background.ts index c3eb99378..c68a740a4 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -51,6 +51,7 @@ import { import { senderCertificateService } from './services/senderCertificate'; import { GROUP_CREDENTIALS_KEY } from './services/groupCredentialFetcher'; import * as KeyboardLayout from './services/keyboardLayout'; +import * as StorageService from './services/storage'; import { RoutineProfileRefresher } from './routineProfileRefresh'; import { isMoreRecentThan, isOlderThan, toDayMillis } from './util/timestamp'; import { isValidReactionEmoji } from './reactions/isValidReactionEmoji'; @@ -786,7 +787,7 @@ export async function startApp(): Promise { window.isBeforeVersion(lastVersion, 'v1.36.0-beta.1') && window.isAfterVersion(lastVersion, 'v1.35.0-beta.1') ) { - await window.Signal.Services.eraseAllStorageServiceState(); + await StorageService.eraseAllStorageServiceState(); } if (window.isBeforeVersion(lastVersion, 'v5.2.0')) { @@ -846,6 +847,8 @@ export async function startApp(): Promise { // Don't block on the following operation window.Signal.Data.ensureFilePermissions(); + + StorageService.reprocessUnknownFields(); } try { @@ -1737,7 +1740,7 @@ export async function startApp(): Promise { }); async function runStorageService() { - window.Signal.Services.enableStorageService(); + StorageService.enableStorageService(); if (window.ConversationController.areWePrimaryDevice()) { log.warn( @@ -3548,7 +3551,7 @@ export async function startApp(): Promise { } case FETCH_LATEST_ENUM.STORAGE_MANIFEST: log.info('onFetchLatestSync: fetching latest manifest'); - await window.Signal.Services.runStorageServiceSyncJob(); + await StorageService.runStorageServiceSyncJob(); break; case FETCH_LATEST_ENUM.SUBSCRIPTION_STATUS: log.info('onFetchLatestSync: fetching latest subscription status'); @@ -3582,12 +3585,12 @@ export async function startApp(): Promise { 'onKeysSync: updated storage service key, erasing state and fetching' ); await window.storage.put('storageKey', storageServiceKeyBase64); - await window.Signal.Services.eraseAllStorageServiceState({ + await StorageService.eraseAllStorageServiceState({ keepUnknownFields: true, }); } - await window.Signal.Services.runStorageServiceSyncJob(); + await StorageService.runStorageServiceSyncJob(); } } diff --git a/ts/components/SendStoryModal.tsx b/ts/components/SendStoryModal.tsx index 66a5ed719..07b14dd5f 100644 --- a/ts/components/SendStoryModal.tsx +++ b/ts/components/SendStoryModal.tsx @@ -444,7 +444,7 @@ export const SendStoryModal = ({ <>
{selectedNames}