From 4ea709f2e4d95293b2dc89e36042b03857768b44 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 22 Feb 2022 17:06:19 -0800 Subject: [PATCH] Don't fetch profiles on conversation open if we've left group --- ts/views/conversation_view.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index 4982c00b31..f51b0b12d2 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -39,6 +39,7 @@ import { reportSpamJobQueue } from '../jobs/reportSpamJobQueue'; import type { GroupNameCollisionsWithIdsByTitle } from '../util/groupMemberNameCollisions'; import { isDirectConversation, + isGroup, isGroupV1, } from '../util/whatTypeOfConversation'; import { findAndFormatContact } from '../util/findAndFormatContact'; @@ -112,6 +113,7 @@ import { showToast } from '../util/showToast'; import { viewSyncJobQueue } from '../jobs/viewSyncJobQueue'; import { viewedReceiptsJobQueue } from '../jobs/viewedReceiptsJobQueue'; import { RecordingState } from '../state/ducks/audioRecorder'; +import { UUIDKind } from '../types/UUID'; type AttachmentOptions = { messageId: string; @@ -1253,11 +1255,17 @@ export class ConversationView extends window.Backbone.View { ); this.model.throttledFetchSMSOnlyUUID(); - strictAssert( - this.model.throttledGetProfiles !== undefined, - 'Conversation model should be initialized' - ); - await this.model.throttledGetProfiles(); + const ourUuid = window.textsecure.storage.user.getUuid(UUIDKind.ACI); + if ( + !isGroup(this.model.attributes) || + (ourUuid && this.model.hasMember(ourUuid.toString())) + ) { + strictAssert( + this.model.throttledGetProfiles !== undefined, + 'Conversation model should be initialized' + ); + await this.model.throttledGetProfiles(); + } this.model.updateVerified(); }