Skip to content

Commit

Permalink
Merge pull request #1821 from famedly/td/makeKeyPublic
Browse files Browse the repository at this point in the history
feat: make voip key generator public
  • Loading branch information
nico-famedly authored May 22, 2024
2 parents 162a4f3 + d313cbb commit 8c33ce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/src/voip/backend/livekit_backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LiveKitBackend extends CallBackend {
/// used on first join and when someone leaves
///
/// also does the sending for you
Future<void> _makeNewSenderKey(
Future<void> makeNewSenderKey(
GroupCallSession groupCall, bool delayBeforeUsingKeyOurself) async {
final key = secureRandomBytes(32);
final keyIndex = _getNewEncryptionKeyIndex();
Expand Down Expand Up @@ -87,7 +87,7 @@ class LiveKitBackend extends CallBackend {
final myKeys = _encryptionKeysMap[groupCall.localParticipant];

if (myKeys == null || myKeys.isEmpty) {
await _makeNewSenderKey(groupCall, false);
await makeNewSenderKey(groupCall, false);
return;
}

Expand Down Expand Up @@ -186,7 +186,7 @@ class LiveKitBackend extends CallBackend {
if (myKeys == null || myLatestKey == null) {
Logs().w(
'[VOIP E2EE] _sendEncryptionKeysEvent Tried to send encryption keys event but no keys found!');
await _makeNewSenderKey(groupCall, false);
await makeNewSenderKey(groupCall, false);
await _sendEncryptionKeysEvent(
groupCall,
keyIndex,
Expand Down Expand Up @@ -392,7 +392,7 @@ class LiveKitBackend extends CallBackend {
if (groupCall.voip.enableSFUE2EEKeyRatcheting) {
await _ratchetLocalParticipantKey(groupCall, anyJoined);
} else {
await _makeNewSenderKey(groupCall, true);
await makeNewSenderKey(groupCall, true);
}
}

Expand All @@ -409,7 +409,7 @@ class LiveKitBackend extends CallBackend {
}
_memberLeaveEncKeyRotateDebounceTimer =
Timer(CallTimeouts.makeKeyDelay, () async {
await _makeNewSenderKey(groupCall, true);
await makeNewSenderKey(groupCall, true);
});
}

Expand Down
6 changes: 0 additions & 6 deletions lib/src/voip/group_call_session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,6 @@ class GroupCallSession {

/// compltetely rebuilds the local _participants list
Future<void> onMemberStateChanged() async {
if (state != GroupCallState.entered) {
Logs().d(
'[VOIP] early return onMemberStateChanged, group call state is not Entered. Actual state: ${state.toString()} ');
return;
}

// The member events may be received for another room, which we will ignore.
final mems =
room.getCallMembershipsFromRoom().values.expand((element) => element);
Expand Down

0 comments on commit 8c33ce3

Please sign in to comment.