You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
@@ -19,12 +19,13 @@ import { EventType } from "matrix-js-sdk/src/@types/event";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
|
||||
export interface TimelineCallState {
|
||||
callId?: string;
|
||||
callId: string;
|
||||
isVoice: boolean;
|
||||
}
|
||||
|
||||
export default class CallEventGrouper {
|
||||
invite: MatrixEvent;
|
||||
callId: string;
|
||||
|
||||
private isVoice(): boolean {
|
||||
const invite = this.invite;
|
||||
@@ -43,11 +44,13 @@ export default class CallEventGrouper {
|
||||
|
||||
public add(event: MatrixEvent) {
|
||||
if (event.getType() === EventType.CallInvite) this.invite = event;
|
||||
this.callId = event.getContent().call_id;
|
||||
}
|
||||
|
||||
public getState(): TimelineCallState {
|
||||
return {
|
||||
isVoice: this.isVoice(),
|
||||
callId: this.callId,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user