Use disptacher so that https://github.com/matrix-org/matrix-react-sdk/pull/6691 has effect
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
470bc0ffe7
commit
072fdf1cb8
|
@ -108,24 +108,34 @@ export default class CallEventGrouper extends EventEmitter {
|
||||||
return [...this.events][0].getContent().call_id;
|
return [...this.events][0].getContent().call_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private get roomId(): string {
|
||||||
|
return [...this.events][0]?.getRoomId();
|
||||||
|
}
|
||||||
|
|
||||||
private onSilencedCallsChanged = () => {
|
private onSilencedCallsChanged = () => {
|
||||||
const newState = CallHandler.sharedInstance().isCallSilenced(this.callId);
|
const newState = CallHandler.sharedInstance().isCallSilenced(this.callId);
|
||||||
this.emit(CallEventGrouperEvent.SilencedChanged, newState);
|
this.emit(CallEventGrouperEvent.SilencedChanged, newState);
|
||||||
};
|
};
|
||||||
|
|
||||||
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 New Issue