Merge pull request #6705 from SimonBrandner/fix/call-tile-dispatch/18825
Use disptacher to answer/reject calls in call tiles
This commit is contained in:
commit
495b6dcd97
1 changed files with 15 additions and 5 deletions
|
@ -105,8 +105,12 @@ export default class CallEventGrouper extends EventEmitter {
|
||||||
return ![...this.events].some((event) => event.sender?.userId === MatrixClientPeg.get().getUserId());
|
return ![...this.events].some((event) => event.sender?.userId === MatrixClientPeg.get().getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private get callId(): string {
|
private get callId(): string | undefined {
|
||||||
return [...this.events][0].getContent().call_id;
|
return [...this.events][0]?.getContent()?.call_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
private get roomId(): string | undefined {
|
||||||
|
return [...this.events][0]?.getRoomId();
|
||||||
}
|
}
|
||||||
|
|
||||||
private onSilencedCallsChanged = () => {
|
private onSilencedCallsChanged = () => {
|
||||||
|
@ -119,18 +123,24 @@ export default class CallEventGrouper extends EventEmitter {
|
||||||
};
|
};
|
||||||
|
|
||||||
public answerCall = () => {
|
public answerCall = () => {
|
||||||
this.call?.answer();
|
defaultDispatcher.dispatch({
|
||||||
|
action: 'answer',
|
||||||
|
room_id: this.roomId,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public rejectCall = () => {
|
public rejectCall = () => {
|
||||||
this.call?.reject();
|
defaultDispatcher.dispatch({
|
||||||
|
action: 'reject',
|
||||||
|
room_id: this.roomId,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public callBack = () => {
|
public callBack = () => {
|
||||||
defaultDispatcher.dispatch({
|
defaultDispatcher.dispatch({
|
||||||
action: 'place_call',
|
action: 'place_call',
|
||||||
type: this.isVoice ? CallType.Voice : CallType.Video,
|
type: this.isVoice ? CallType.Voice : CallType.Video,
|
||||||
room_id: [...this.events][0]?.getRoomId(),
|
room_id: this.roomId,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue