From ae01ad42768de2be67ace9c01ed61277b32d7c33 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Wed, 7 Sep 2022 11:31:13 -0700 Subject: [PATCH] Persist hasSetMyStoriesPrivacy in storage service --- protos/SignalStorage.proto | 1 + ts/services/storageRecordOps.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/protos/SignalStorage.proto b/protos/SignalStorage.proto index 3b7bcc4e40c3..a2c0255bc216 100644 --- a/protos/SignalStorage.proto +++ b/protos/SignalStorage.proto @@ -152,6 +152,7 @@ message AccountRecord { optional string subscriberCurrencyCode = 22; optional bool displayBadgesOnProfile = 23; optional bool keepMutedChatsArchived = 25; + optional bool hasSetMyStoriesPrivacy = 26; } message StoryDistributionListRecord { diff --git a/ts/services/storageRecordOps.ts b/ts/services/storageRecordOps.ts index 36b60b260fda..bfd961e401a3 100644 --- a/ts/services/storageRecordOps.ts +++ b/ts/services/storageRecordOps.ts @@ -343,6 +343,11 @@ export function toAccountRecord( accountRecord.keepMutedChatsArchived = keepMutedChatsArchived; } + const hasSetMyStoriesPrivacy = window.storage.get('hasSetMyStoriesPrivacy'); + if (hasSetMyStoriesPrivacy !== undefined) { + accountRecord.hasSetMyStoriesPrivacy = hasSetMyStoriesPrivacy; + } + applyUnknownFields(accountRecord, conversation); return accountRecord; @@ -1024,6 +1029,7 @@ export async function mergeAccountRecord( subscriberCurrencyCode, displayBadgesOnProfile, keepMutedChatsArchived, + hasSetMyStoriesPrivacy, } = accountRecord; const updatedConversations = new Array(); @@ -1216,6 +1222,7 @@ export async function mergeAccountRecord( } window.storage.put('displayBadgesOnProfile', Boolean(displayBadgesOnProfile)); window.storage.put('keepMutedChatsArchived', Boolean(keepMutedChatsArchived)); + window.storage.put('hasSetMyStoriesPrivacy', Boolean(hasSetMyStoriesPrivacy)); const ourID = window.ConversationController.getOurConversationId();