From e5a203a48e837a741dde1e002d6cd82a8cf16b64 Mon Sep 17 00:00:00 2001 From: warrickct Date: Tue, 16 Nov 2021 13:09:44 +1100 Subject: [PATCH] adding setting of active_at to hide unapproved messages. --- ts/models/conversation.ts | 4 ++++ ts/receiver/queuedJob.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/models/conversation.ts b/ts/models/conversation.ts index b7f107557..173ad05f2 100644 --- a/ts/models/conversation.ts +++ b/ts/models/conversation.ts @@ -1407,6 +1407,10 @@ export class ConversationModel extends Backbone.Model { this.set({ isApproved: value, }); + + // to exclude the conversation from left pane messages list and message requests + if (value === false) this.set({ active_at: undefined }); + await this.commit(); } } diff --git a/ts/receiver/queuedJob.ts b/ts/receiver/queuedJob.ts index 6c185b5d8..00ce7d73c 100644 --- a/ts/receiver/queuedJob.ts +++ b/ts/receiver/queuedJob.ts @@ -314,8 +314,8 @@ async function handleRegularMessage( if (type === 'outgoing') { handleSyncedReceipts(message, conversation); - // TODO: Can we assume sync receipts are always from linked device outgoings? - if (dataMessage.body !== 'unapprove') conversation.setIsApproved(true); + // assumes sync receipts are always from linked device outgoings? + conversation.setIsApproved(true); } const conversationActiveAt = conversation.get('active_at');