fix: correct group call hangup signaling and connection resilience
- Include pending peers in hangup notification so ringing users get immediate feedback instead of waiting for the 60s timeout - Sign individual hangup events per peer with correct p-tag instead of reusing a single event with the first peer's tag - Stop treating ICE DISCONNECTED as terminal; only hang up on FAILED since DISCONNECTED is often transient (network switch, packet loss) - Send "busy" reject when receiving a call while already in one https://claude.ai/code/session_01HpowdWMK77pA35ABn9XWpD
This commit is contained in:
+11
-3
@@ -110,7 +110,15 @@ class CallManager(
|
||||
|
||||
if (!isFollowing(callerPubKey)) return
|
||||
|
||||
if (_state.value !is CallState.Idle) return
|
||||
if (_state.value !is CallState.Idle) {
|
||||
// Already in a call — send a "busy" reject so the caller gets
|
||||
// immediate feedback instead of waiting for the 60s timeout.
|
||||
scope.launch {
|
||||
val result = factory.createReject(callerPubKey, callId, "busy", signer = signer)
|
||||
publishEvent(result.wrap)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
val groupMembers = event.groupMembers()
|
||||
|
||||
@@ -341,12 +349,12 @@ class CallManager(
|
||||
}
|
||||
|
||||
is CallState.Connecting -> {
|
||||
peerPubKeys = current.peerPubKeys
|
||||
peerPubKeys = current.peerPubKeys + current.pendingPeerPubKeys
|
||||
callId = current.callId
|
||||
}
|
||||
|
||||
is CallState.Connected -> {
|
||||
peerPubKeys = current.peerPubKeys
|
||||
peerPubKeys = current.allPeerPubKeys
|
||||
callId = current.callId
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user