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:
+7
-3
@@ -157,13 +157,17 @@ class WebRtcCallFactory {
|
||||
reason: String = "",
|
||||
signer: NostrSigner,
|
||||
): GroupResult {
|
||||
val template = CallHangupEvent.build(peerPubKeys.first(), callId, reason)
|
||||
val signed = signer.sign(template)
|
||||
// Each peer gets its own signed hangup with the correct `p` tag
|
||||
// targeting that specific recipient.
|
||||
var firstSigned: Event? = null
|
||||
val wraps =
|
||||
peerPubKeys.map { pubKey ->
|
||||
val template = CallHangupEvent.build(pubKey, callId, reason)
|
||||
val signed = signer.sign(template)
|
||||
if (firstSigned == null) firstSigned = signed
|
||||
GiftWrapEvent.create(event = signed, recipientPubKey = pubKey, expirationDelta = WRAP_EXPIRATION_SECONDS)
|
||||
}
|
||||
return GroupResult(signed, wraps)
|
||||
return GroupResult(firstSigned!!, wraps)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user