|
|
@@ -31,7 +31,6 @@ export class E2EEncryption {
|
|
31
|
31
|
|
|
32
|
32
|
this._conferenceJoined = false;
|
|
33
|
33
|
this._enabled = false;
|
|
34
|
|
- this._initialized = false;
|
|
35
|
34
|
this._key = undefined;
|
|
36
|
35
|
this._enabling = undefined;
|
|
37
|
36
|
|
|
|
@@ -130,19 +129,16 @@ export class E2EEncryption {
|
|
130
|
129
|
|
|
131
|
130
|
if (enabled) {
|
|
132
|
131
|
await this._olmAdapter.initSessions();
|
|
|
132
|
+ } else {
|
|
|
133
|
+ for (const participant of this.conference.getParticipants()) {
|
|
|
134
|
+ this._e2eeCtx.cleanup(participant.getId());
|
|
|
135
|
+ }
|
|
|
136
|
+ this._olmAdapter.clearAllParticipantsSessions();
|
|
133
|
137
|
}
|
|
134
|
138
|
|
|
135
|
139
|
this.conference.setLocalParticipantProperty('e2ee.enabled', enabled);
|
|
136
|
140
|
|
|
137
|
|
- if (!this._initialized && enabled) {
|
|
138
|
|
- // Need to re-create the peerconnections in order to apply the insertable streams constraint.
|
|
139
|
|
- // TODO: this was necessary due to some audio issues when indertable streams are used
|
|
140
|
|
- // even though encryption is not performed. This should be fixed in the browser eventually.
|
|
141
|
|
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1103280
|
|
142
|
|
- this.conference._restartMediaSessions();
|
|
143
|
|
-
|
|
144
|
|
- this._initialized = true;
|
|
145
|
|
- }
|
|
|
141
|
+ this.conference._restartMediaSessions();
|
|
146
|
142
|
|
|
147
|
143
|
// Generate a random key in case we are enabling.
|
|
148
|
144
|
this._key = enabled ? this._generateKey() : false;
|