diff --git a/voice.py b/voice.py index a3de111..8dd29f1 100644 --- a/voice.py +++ b/voice.py @@ -269,6 +269,8 @@ class VoiceSession: # Set caller's key(s) — decrypts incoming audio # Use all collected keys with their correct indices (Element Call may rotate) + # Also set as shared key fallback: Rust FFI may not use per-participant + # key for remote participants in all code paths. if self._caller_key: caller_id = remote_identity or self._caller_identity if caller_id: @@ -276,6 +278,10 @@ class VoiceSession: for idx, key in keys_to_set.items(): kp.set_key(caller_id, key, idx) logger.info("Set caller key[%d] for %s (%d bytes)", idx, caller_id, len(key)) + # Shared key fallback: use highest-index caller key + max_idx = max(keys_to_set.keys()) + kp.set_shared_key(keys_to_set[max_idx], max_idx) + logger.info("Set shared key fallback[%d] (%d bytes)", max_idx, len(keys_to_set[max_idx])) else: logger.warning("Have caller key but no caller identity") else: