Skip to content

Commit 83a39a1

Browse files
committed
Revert "move e2ee manager initialization"
This reverts commit ba7fb60.
1 parent a803162 commit 83a39a1

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

Sources/LiveKit/Core/Room.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,18 @@ public class Room: NSObject, ObservableObject, Loggable {
229229

230230
// update options if specified
231231
if let roomOptions, roomOptions != state.options {
232-
log("Updating RoomOptions to \(roomOptions)")
233232
state = _state.mutate {
234233
$0.options = roomOptions
235234
return $0
236235
}
237236
}
238237

238+
// enable E2EE
239+
if let e2eeOptions = state.options.e2eeOptions {
240+
e2eeManager = E2EEManager(e2eeOptions: e2eeOptions)
241+
e2eeManager!.setup(room: self)
242+
}
243+
239244
try await engine.connect(url, token, connectOptions: connectOptions)
240245

241246
log("Connected to \(String(describing: self))", .info)
@@ -290,16 +295,9 @@ extension Room {
290295
await engine.cleanUpRTC()
291296
await cleanUpParticipants(isFullReconnect: isFullReconnect)
292297

293-
// Cleanup E2EE manager
298+
// Cleanup for E2EE
294299
if let e2eeManager {
295300
e2eeManager.cleanUp()
296-
self.e2eeManager = nil
297-
}
298-
299-
// Initialize E2EE manager
300-
if let e2eeOptions = _state.options.e2eeOptions {
301-
e2eeManager = E2EEManager(e2eeOptions: e2eeOptions)
302-
e2eeManager!.setup(room: self)
303301
}
304302

305303
// Reset state

Sources/LiveKit/Extensions/CustomStringConvertible.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,3 @@ extension LKRTCRtpEncodingParameters {
162162
")"
163163
}
164164
}
165-
166-
public extension RoomOptions {
167-
override var description: String {
168-
"RoomOptions(e2eeOptions: \(String(describing: e2eeOptions)))"
169-
}
170-
}

0 commit comments

Comments
 (0)