mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
028290cb1c
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
29 lines
676 B
TypeScript
29 lines
676 B
TypeScript
// Copyright 2026 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { ConversationType } from '../state/ducks/conversations.preload.js';
|
|
import { CallMode } from '../types/CallDisposition.std.js';
|
|
|
|
export const getConversationCallMode = (
|
|
conversation: ConversationType
|
|
): CallMode | null => {
|
|
if (
|
|
conversation.left ||
|
|
conversation.isBlocked ||
|
|
conversation.isMe ||
|
|
!conversation.acceptedMessageRequest
|
|
) {
|
|
return null;
|
|
}
|
|
|
|
if (conversation.type === 'direct') {
|
|
return CallMode.Direct;
|
|
}
|
|
|
|
if (conversation.type === 'group' && conversation.groupVersion === 2) {
|
|
return CallMode.Group;
|
|
}
|
|
|
|
return null;
|
|
};
|