diff --git a/ts/state/selectors/conversations.ts b/ts/state/selectors/conversations.ts index 87e384d1492..01d360dec1d 100644 --- a/ts/state/selectors/conversations.ts +++ b/ts/state/selectors/conversations.ts @@ -29,7 +29,11 @@ import { ContactNameColors, ContactNameColorType } from '../../types/Colors'; import { AvatarDataType } from '../../types/Avatar'; import { isInSystemContacts } from '../../util/isInSystemContacts'; import { sortByTitle } from '../../util/sortByTitle'; -import { isGroupV2 } from '../../util/whatTypeOfConversation'; +import { + isDirectConversation, + isGroupV1, + isGroupV2, +} from '../../util/whatTypeOfConversation'; import { getIntl, @@ -922,8 +926,13 @@ export const getConversationsWithCustomColorSelector = createSelector( export function isMissingRequiredProfileSharing( conversation: ConversationType ): boolean { + const doesConversationRequireIt = + !conversation.left && + (isGroupV1(conversation) || isDirectConversation(conversation)); + return Boolean( - !conversation.profileSharing && + doesConversationRequireIt && + !conversation.profileSharing && window.Signal.RemoteConfig.isEnabled('desktop.mandatoryProfileSharing') && conversation.messageCount && conversation.messageCount > 0 diff --git a/ts/util/whatTypeOfConversation.ts b/ts/util/whatTypeOfConversation.ts index c3e35c9b61e..2049502056f 100644 --- a/ts/util/whatTypeOfConversation.ts +++ b/ts/util/whatTypeOfConversation.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { ConversationAttributesType } from '../model-types.d'; +import { ConversationType } from '../state/ducks/conversations'; import { base64ToArrayBuffer, fromEncodedBinaryToArrayBuffer } from '../Crypto'; export enum ConversationTypes { @@ -12,9 +13,13 @@ export enum ConversationTypes { } export function isDirectConversation( - conversationAttrs: Pick + conversationAttrs: + | Pick + | Pick ): boolean { - return conversationAttrs.type === 'private'; + return ( + conversationAttrs.type === 'private' || conversationAttrs.type === 'direct' + ); } export function isMe(conversationAttrs: ConversationAttributesType): boolean {