Place announcement-only groups behind feature flag

This commit is contained in:
Josh Perez 2021-07-20 16:51:38 -04:00 committed by GitHub
parent dd0baf9ab4
commit bf6c0ce7c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import { get, throttle } from 'lodash';
import { connectToServerWithStoredCredentials } from './util/connectToServerWithStoredCredentials';
export type ConfigKeyType =
| 'desktop.announcementGroup'
| 'desktop.clientExpiration'
| 'desktop.disableGV1'
| 'desktop.groupCalling'

View File

@ -81,6 +81,7 @@ import {
} from '../state/selectors/message';
import { Deletes } from '../messageModifiers/Deletes';
import { Reactions, ReactionModel } from '../messageModifiers/Reactions';
import { isAnnouncementGroupReady } from '../util/isAnnouncementGroupReady';
// TODO: remove once we move away from ArrayBuffers
const FIXMEU8 = Uint8Array;
@ -3016,6 +3017,10 @@ export class ConversationModel extends window.Backbone
return false;
}
if (!isAnnouncementGroupReady()) {
return false;
}
const members = getConversationMembers(this.attributes);
return members.every(conversationAttrs =>
Boolean(conversationAttrs.capabilities?.announcementGroup)

View File

@ -0,0 +1,11 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as RemoteConfig from '../RemoteConfig';
export function isAnnouncementGroupReady(): boolean {
return Boolean(
RemoteConfig.isEnabled('desktop.worksAtSignal') ||
RemoteConfig.isEnabled('desktop.announcementGroup')
);
}