mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-16 05:01:41 +03:00
Add callId
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
20c5735e96
commit
d05b1798b8
1 changed files with 4 additions and 1 deletions
|
@ -19,12 +19,13 @@ import { EventType } from "matrix-js-sdk/src/@types/event";
|
||||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||||
|
|
||||||
export interface TimelineCallState {
|
export interface TimelineCallState {
|
||||||
callId?: string;
|
callId: string;
|
||||||
isVoice: boolean;
|
isVoice: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class CallEventGrouper {
|
export default class CallEventGrouper {
|
||||||
invite: MatrixEvent;
|
invite: MatrixEvent;
|
||||||
|
callId: string;
|
||||||
|
|
||||||
private isVoice(): boolean {
|
private isVoice(): boolean {
|
||||||
const invite = this.invite;
|
const invite = this.invite;
|
||||||
|
@ -43,11 +44,13 @@ export default class CallEventGrouper {
|
||||||
|
|
||||||
public add(event: MatrixEvent) {
|
public add(event: MatrixEvent) {
|
||||||
if (event.getType() === EventType.CallInvite) this.invite = event;
|
if (event.getType() === EventType.CallInvite) this.invite = event;
|
||||||
|
this.callId = event.getContent().call_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getState(): TimelineCallState {
|
public getState(): TimelineCallState {
|
||||||
return {
|
return {
|
||||||
isVoice: this.isVoice(),
|
isVoice: this.isVoice(),
|
||||||
|
callId: this.callId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue