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:
Claude
2026-04-03 02:49:37 +00:00
parent 532d794f40
commit ea65dd76e7
3 changed files with 22 additions and 7 deletions
@@ -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
}