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'; import { connectToServerWithStoredCredentials } from './util/connectToServerWithStoredCredentials';
export type ConfigKeyType = export type ConfigKeyType =
| 'desktop.announcementGroup'
| 'desktop.clientExpiration' | 'desktop.clientExpiration'
| 'desktop.disableGV1' | 'desktop.disableGV1'
| 'desktop.groupCalling' | 'desktop.groupCalling'

View file

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