From 325fb19f55875007ee78f9d0da862df23aa72fbb Mon Sep 17 00:00:00 2001 From: td Date: Tue, 11 Jun 2024 18:18:32 +0530 Subject: [PATCH] chore: do not create participant object on every key --- lib/src/voip/backend/livekit_backend.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/voip/backend/livekit_backend.dart b/lib/src/voip/backend/livekit_backend.dart index 13ad6baf..8f0ff189 100644 --- a/lib/src/voip/backend/livekit_backend.dart +++ b/lib/src/voip/backend/livekit_backend.dart @@ -335,6 +335,8 @@ class LiveKitBackend extends CallBackend { final keyContent = EncryptionKeysEventContent.fromJson(content); final callId = keyContent.callId; + final p = + CallParticipant(groupCall.voip, userId: userId, deviceId: deviceId); if (keyContent.keys.isEmpty) { Logs().w( @@ -342,7 +344,7 @@ class LiveKitBackend extends CallBackend { return; } else { Logs().i( - '[VOIP E2EE]: onCallEncryption, got keys from $userId:$deviceId ${keyContent.toJson()}'); + '[VOIP E2EE]: onCallEncryption, got keys from ${p.id} ${keyContent.toJson()}'); } for (final key in keyContent.keys) { @@ -350,7 +352,7 @@ class LiveKitBackend extends CallBackend { final encryptionKeyIndex = key.index; await _setEncryptionKey( groupCall, - CallParticipant(groupCall.voip, userId: userId, deviceId: deviceId), + p, encryptionKeyIndex, // base64Decode here because we receive base64Encoded version base64Decode(encryptionKey),