chore: do not create participant object on every key
This commit is contained in:
parent
7241bb8dc5
commit
325fb19f55
|
|
@ -335,6 +335,8 @@ class LiveKitBackend extends CallBackend {
|
||||||
final keyContent = EncryptionKeysEventContent.fromJson(content);
|
final keyContent = EncryptionKeysEventContent.fromJson(content);
|
||||||
|
|
||||||
final callId = keyContent.callId;
|
final callId = keyContent.callId;
|
||||||
|
final p =
|
||||||
|
CallParticipant(groupCall.voip, userId: userId, deviceId: deviceId);
|
||||||
|
|
||||||
if (keyContent.keys.isEmpty) {
|
if (keyContent.keys.isEmpty) {
|
||||||
Logs().w(
|
Logs().w(
|
||||||
|
|
@ -342,7 +344,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Logs().i(
|
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) {
|
for (final key in keyContent.keys) {
|
||||||
|
|
@ -350,7 +352,7 @@ class LiveKitBackend extends CallBackend {
|
||||||
final encryptionKeyIndex = key.index;
|
final encryptionKeyIndex = key.index;
|
||||||
await _setEncryptionKey(
|
await _setEncryptionKey(
|
||||||
groupCall,
|
groupCall,
|
||||||
CallParticipant(groupCall.voip, userId: userId, deviceId: deviceId),
|
p,
|
||||||
encryptionKeyIndex,
|
encryptionKeyIndex,
|
||||||
// base64Decode here because we receive base64Encoded version
|
// base64Decode here because we receive base64Encoded version
|
||||||
base64Decode(encryptionKey),
|
base64Decode(encryptionKey),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue