Skip to content

Commit 072fdf1

Browse files
committed
Use disptacher so that matrix-org#6691 has effect
Signed-off-by: Šimon Brandner <[email protected]>
1 parent 470bc0f commit 072fdf1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/structures/CallEventGrouper.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,34 @@ export default class CallEventGrouper extends EventEmitter {
108108
return [...this.events][0].getContent().call_id;
109109
}
110110

111+
private get roomId(): string {
112+
return [...this.events][0]?.getRoomId();
113+
}
114+
111115
private onSilencedCallsChanged = () => {
112116
const newState = CallHandler.sharedInstance().isCallSilenced(this.callId);
113117
this.emit(CallEventGrouperEvent.SilencedChanged, newState);
114118
};
115119

116120
public answerCall = () => {
117-
this.call?.answer();
121+
defaultDispatcher.dispatch({
122+
action: 'answer',
123+
room_id: this.roomId,
124+
});
118125
};
119126

120127
public rejectCall = () => {
121-
this.call?.reject();
128+
defaultDispatcher.dispatch({
129+
action: 'reject',
130+
room_id: this.roomId,
131+
});
122132
};
123133

124134
public callBack = () => {
125135
defaultDispatcher.dispatch({
126136
action: 'place_call',
127137
type: this.isVoice ? CallType.Voice : CallType.Video,
128-
room_id: [...this.events][0]?.getRoomId(),
138+
room_id: this.roomId,
129139
});
130140
};
131141

0 commit comments

Comments
 (0)