@@ -23,10 +23,10 @@ import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
23
23
import { CallType } from "matrix-js-sdk/src/webrtc/call" ;
24
24
import { NamespacedValue } from "matrix-js-sdk/src/NamespacedValue" ;
25
25
import { IWidgetApiRequest , MatrixWidgetType } from "matrix-widget-api" ;
26
+ import { MatrixEvent , MatrixEventEvent } from "matrix-js-sdk/src/models/event" ;
26
27
27
28
import type EventEmitter from "events" ;
28
29
import type { IMyDevice } from "matrix-js-sdk/src/client" ;
29
- import type { MatrixEvent } from "matrix-js-sdk/src/models/event" ;
30
30
import type { Room } from "matrix-js-sdk/src/models/room" ;
31
31
import type { RoomMember } from "matrix-js-sdk/src/models/room-member" ;
32
32
import type { ClientWidgetApi } from "matrix-widget-api" ;
@@ -656,6 +656,7 @@ export class ElementCall extends Call {
656
656
client ,
657
657
) ;
658
658
659
+ this . groupCall . on ( MatrixEventEvent . BeforeRedaction , this . onBeforeRedaction ) ;
659
660
this . room . on ( RoomStateEvent . Update , this . onRoomState ) ;
660
661
this . on ( CallEvent . ConnectionState , this . onConnectionState ) ;
661
662
this . on ( CallEvent . Participants , this . onParticipants ) ;
@@ -837,6 +838,7 @@ export class ElementCall extends Call {
837
838
}
838
839
839
840
public destroy ( ) {
841
+ this . groupCall . off ( MatrixEventEvent . BeforeRedaction , this . onBeforeRedaction ) ;
840
842
WidgetStore . instance . removeVirtualWidget ( this . widget . id , this . groupCall . getRoomId ( ) ! ) ;
841
843
this . room . off ( RoomStateEvent . Update , this . onRoomState ) ;
842
844
this . off ( CallEvent . ConnectionState , this . onConnectionState ) ;
@@ -885,6 +887,10 @@ export class ElementCall extends Call {
885
887
) ;
886
888
}
887
889
890
+ private onBeforeRedaction = ( ) : void => {
891
+ this . disconnect ( ) ;
892
+ } ;
893
+
888
894
private onRoomState = ( ) => {
889
895
this . updateParticipants ( ) ;
890
896
0 commit comments