From 1d5b3611590a66ef49f4fcd9b571d891cf2c44b6 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Thu, 21 Jul 2022 19:05:55 -0400 Subject: [PATCH] Drop incoming story messages if stories are turned off --- ts/textsecure/MessageReceiver.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index fd1e36d5a4..cbafa4094f 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -1856,6 +1856,12 @@ export default class MessageReceiver const attachments: Array = []; + if (!window.Events.getHasStoriesEnabled()) { + log.info('MessageReceiver.handleStoryMessage: dropping', logId); + this.removeFromCache(envelope); + return; + } + if (msg.fileAttachment) { const attachment = processAttachment(msg.fileAttachment); attachments.push(attachment); @@ -2582,6 +2588,14 @@ export default class MessageReceiver } if (sentMessage.storyMessageRecipients && sentMessage.isRecipientUpdate) { + if (!window.Events.getHasStoriesEnabled()) { + log.info( + 'MessageReceiver.handleSyncMessage: dropping story recipients update' + ); + this.removeFromCache(envelope); + return; + } + const ev = new StoryRecipientUpdateEvent( { destinationUuid: envelope.destinationUuid.toString(),