Calling Reactions

This commit is contained in:
ayumi-signal
2023-11-16 11:55:35 -08:00
committed by GitHub
parent ab187ab265
commit 4603832258
24 changed files with 942 additions and 35 deletions
+19 -1
View File
@@ -1,10 +1,13 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { AudioDevice } from '@signalapp/ringrtc';
import type { AudioDevice, Reaction as CallReaction } from '@signalapp/ringrtc';
import type { ConversationType } from '../state/ducks/conversations';
import type { AciString, ServiceIdString } from './ServiceId';
export const MAX_CALLING_REACTIONS = 5;
export const CALLING_REACTIONS_LIFETIME = 4000;
// These are strings (1) for the database (2) for Storybook.
export enum CallMode {
Direct = 'Direct',
@@ -34,6 +37,16 @@ export type PresentedSource = {
name: string;
};
// export type ActiveCallReactionsType = {
// [timestamp: number]: ReadonlyArray<CallReaction>;
// };
export type ActiveCallReaction = {
timestamp: number;
} & CallReaction;
export type ActiveCallReactionsType = ReadonlyArray<ActiveCallReaction>;
export type ActiveCallBaseType = {
conversation: ConversationType;
hasLocalAudio: boolean;
@@ -50,6 +63,7 @@ export type ActiveCallBaseType = {
settingsDialogOpen: boolean;
showNeedsScreenRecordingPermissionsWarning?: boolean;
showParticipantsList: boolean;
reactions?: ActiveCallReactionsType;
};
export type ActiveDirectCallType = ActiveCallBaseType & {
@@ -73,8 +87,10 @@ export type ActiveDirectCallType = ActiveCallBaseType & {
export type ActiveGroupCallType = ActiveCallBaseType & {
callMode: CallMode.Group;
connectionState: GroupCallConnectionState;
conversationsByDemuxId: ConversationsByDemuxIdType;
conversationsWithSafetyNumberChanges: Array<ConversationType>;
joinState: GroupCallJoinState;
localDemuxId: number | undefined;
maxDevices: number;
deviceCount: number;
groupMembers: Array<Pick<ConversationType, 'id' | 'firstName' | 'title'>>;
@@ -148,6 +164,8 @@ export type GroupCallRemoteParticipantType = ConversationType & {
videoAspectRatio: number;
};
export type ConversationsByDemuxIdType = Map<number, ConversationType>;
// Similar to RingRTC's `VideoRequest` but without the `framerate` property.
export type GroupCallVideoRequest = {
demuxId: number;