Don't ring large groups

This commit is contained in:
Evan Hahn
2021-09-02 17:34:38 -05:00
committed by GitHub
parent 1f45bce0a2
commit 3e18a8a337
13 changed files with 144 additions and 44 deletions

View File

@@ -0,0 +1,14 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { parseIntWithFallback } from '../util/parseIntWithFallback';
import { getValue } from '../RemoteConfig';
import type { ConversationType } from '../state/ducks/conversations';
const getMaxGroupCallRingSize = (): number =>
parseIntWithFallback(getValue('global.calling.maxGroupCallRingSize'), 16);
export const isConversationTooBigToRing = (
conversation: Readonly<Pick<ConversationType, 'memberships'>>
): boolean =>
(conversation.memberships?.length || 0) >= getMaxGroupCallRingSize();