Mandatory profile sharing: Don't disable react/reply in GroupV2 groups

This commit is contained in:
Scott Nonnenberg 2021-09-02 16:29:46 -07:00 committed by GitHub
parent 0793aa6b43
commit 1dda705c52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -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

View file

@ -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<ConversationAttributesType, 'type'>
conversationAttrs:
| Pick<ConversationAttributesType, 'type'>
| Pick<ConversationType, 'type'>
): boolean {
return conversationAttrs.type === 'private';
return (
conversationAttrs.type === 'private' || conversationAttrs.type === 'direct'
);
}
export function isMe(conversationAttrs: ConversationAttributesType): boolean {