From 23ca19b125bf42319050448f52b26386ec09b18d Mon Sep 17 00:00:00 2001 From: warrickct Date: Mon, 22 Nov 2021 16:18:19 +1100 Subject: [PATCH] Only updating approval when it is a true value as we consider a block a decline. --- ts/models/conversation.ts | 2 +- ts/receiver/configMessage.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ts/models/conversation.ts b/ts/models/conversation.ts index c05077662..e30ff986e 100644 --- a/ts/models/conversation.ts +++ b/ts/models/conversation.ts @@ -1517,7 +1517,7 @@ export class ConversationModel extends Backbone.Model { } public isApproved() { - return Boolean(this.get('isApproved')); + return this.get('isApproved'); } public getTitle() { diff --git a/ts/receiver/configMessage.ts b/ts/receiver/configMessage.ts index eb7ce798b..297a8ea79 100644 --- a/ts/receiver/configMessage.ts +++ b/ts/receiver/configMessage.ts @@ -125,7 +125,11 @@ const handleContactReceived = async ( // updateProfile will do a commit for us contactConvo.set('active_at', _.toNumber(envelope.timestamp)); - if (window.lokiFeatureFlags.useMessageRequests === true && window.inboxStore?.getState().userConfig.messageRequests) { + if ( + window.lokiFeatureFlags.useMessageRequests === true && + window.inboxStore?.getState().userConfig.messageRequests && + contactReceived.isApproved === true + ) { contactConvo.setIsApproved(Boolean(contactReceived.isApproved)); if (contactReceived.isBlocked === true) {