Place announcement-only groups behind feature flag
This commit is contained in:
parent
dd0baf9ab4
commit
bf6c0ce7c0
3 changed files with 17 additions and 0 deletions
|
@ -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'
|
||||
|
|
|
@ -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)
|
||||
|
|
11
ts/util/isAnnouncementGroupReady.ts
Normal file
11
ts/util/isAnnouncementGroupReady.ts
Normal 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')
|
||||
);
|
||||
}
|
Loading…
Reference in a new issue