File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
src/components/structures Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,12 @@ export default class CallEventGrouper extends EventEmitter {
105105 return ! [ ...this . events ] . some ( ( event ) => event . sender ?. userId === MatrixClientPeg . get ( ) . getUserId ( ) ) ;
106106 }
107107
108- private get callId ( ) : string {
109- return [ ...this . events ] [ 0 ] . getContent ( ) . call_id ;
108+ private get callId ( ) : string | undefined {
109+ return [ ...this . events ] [ 0 ] ?. getContent ( ) ?. call_id ;
110+ }
111+
112+ private get roomId ( ) : string | undefined {
113+ return [ ...this . events ] [ 0 ] ?. getRoomId ( ) ;
110114 }
111115
112116 private onSilencedCallsChanged = ( ) => {
@@ -119,18 +123,24 @@ export default class CallEventGrouper extends EventEmitter {
119123 } ;
120124
121125 public answerCall = ( ) => {
122- this . call ?. answer ( ) ;
126+ defaultDispatcher . dispatch ( {
127+ action : 'answer' ,
128+ room_id : this . roomId ,
129+ } ) ;
123130 } ;
124131
125132 public rejectCall = ( ) => {
126- this . call ?. reject ( ) ;
133+ defaultDispatcher . dispatch ( {
134+ action : 'reject' ,
135+ room_id : this . roomId ,
136+ } ) ;
127137 } ;
128138
129139 public callBack = ( ) => {
130140 defaultDispatcher . dispatch ( {
131141 action : 'place_call' ,
132142 type : this . isVoice ? CallType . Voice : CallType . Video ,
133- room_id : [ ... this . events ] [ 0 ] ?. getRoomId ( ) ,
143+ room_id : this . roomId ,
134144 } ) ;
135145 } ;
136146
You can’t perform that action at this time.
0 commit comments