All signaling event types in group calls (answer, hangup, reject,
renegotiate) now include p-tags for every group member, matching the
pattern already used by CallOfferEvent. This allows signing the inner
event once and gift-wrapping it separately for each recipient.
- Add Set<HexKey> build() overloads to CallAnswerEvent, CallHangupEvent,
CallRejectEvent, and CallRenegotiateEvent
- Add createGroupCallAnswer, createGroupRenegotiate factory methods
- Fix createGroupHangup to sign once instead of per-peer
- Update createGroupReject to accept full member set
- Update CallManager to use group methods when in group call
- Document group call p-tag convention in NIP-AC spec
- Add tests for all group build overloads
https://claude.ai/code/session_013h2E7spwHDgSjunqumsYgp
- 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
Add ability to invite new users into an ongoing call:
- CallManager.invitePeer() sends a call offer to a new peer using
the current callId, adding them to pendingPeerPubKeys
- CallController.invitePeer() exposes this to the UI layer
- Add PersonAdd button to connected call controls
- Add AddParticipantDialog with user search (reuses UserSuggestionState)
- New strings: call_add_participant, call_search_users
Rewrite CallScreenPreviews to showcase all call states:
1. Offering P2P call (Calling...)
2. Offering group call (3 avatars)
3. Connecting
4. Incoming voice call
5. Incoming video call
6. Incoming group call (4 avatars)
7. Connected P2P voice call with controls
8. Connected muted + video + speaker
9. Connected group call with pending peers
10. Connected with Bluetooth audio
11. Call ended
12. Large group (5+ members, +N badge)
13. PiP calling
14. PiP connected
https://claude.ai/code/session_01LR8NmFGdMoDTVcfKjL7HWR
The call now starts immediately when the first peer answers instead
of waiting for all participants. Remaining peers are tracked as
pending and shown in the UI with a "Waiting for others to join..."
indicator. When a pending peer answers, they move to the connected
set. If a pending peer rejects or hangs up, they're silently removed.
Changes:
- Add pendingPeerPubKeys to Connecting and Connected states
- Add allPeerPubKeys helper on Connected for UI rendering
- Split peers into connected/pending on first answer in onCallAnswered
- Handle subsequent answers in Connecting and Connected states
- Carry pending peers through Connecting -> Connected transition
- Show all peers (connected + pending) in call UI avatars
- Display "Waiting for others to join..." when pending peers exist
https://claude.ai/code/session_01LR8NmFGdMoDTVcfKjL7HWR
When a peer hangs up or rejects in a group call, remove them from the
participant set instead of ending the entire call. The call only ends
when no peers remain (all others left). Similarly, if a peer rejects
during the Offering phase of a group call, remove them but continue
ringing remaining peers.
For incoming group calls, if the original caller hangs up the call
ends immediately. If another group member leaves, the call continues
as long as at least 2 members (including self) remain.
https://claude.ai/code/session_01LR8NmFGdMoDTVcfKjL7HWR
Extends the NIP-AC P2P call signaling to support group calls by
sending individual gift-wrapped offers to each member of the group,
all sharing the same call-id.
- CallOfferEvent: add multi-pubkey build overload, groupMembers(),
isGroupCall(), and recipientPubKeys() helpers
- WebRtcCallFactory: add GroupResult type, createGroupCallOffer(),
createGroupHangup(), and createGroupReject() methods
- CallState: change peerPubKey to peerPubKeys (Set<HexKey>) across
Offering, Connecting, Connected, and Ended states; add groupMembers
field to IncomingCall
- CallManager: add initiateGroupCall() that creates a single signed
offer with p tags for every callee and gift-wraps it individually;
hangup sends to all peers in a group call
- CallController: add initiateGroupCall() entry point
- Tests: add group call offer tests for p tags, call-id, call-type,
and expiration
https://claude.ai/code/session_01WafqMofFQfWCQA5TcLvHRb
When a user is logged in on multiple devices, all devices ring on an
incoming call. Previously, accepting or rejecting on one device left the
others still ringing.
Now, acceptCall() and rejectCall() also publish a self-addressed
gift-wrapped event (to the user's own pubkey) so other devices receive
it and transition out of the IncomingCall state. Added ANSWERED_ELSEWHERE
end reason and handling in onCallAnswered/onCallRejected for IncomingCall
state.
https://claude.ai/code/session_01X9juzyPYWqxRMCgDWEw8R1
When toggling video mid-call, addVideoTrack triggers
onRenegotiationNeeded but the callback was empty — the remote peer
never received the updated SDP, so video never appeared on their side.
This wires up the full renegotiation flow using the existing
CallRenegotiateEvent (kind 25055):
- WebRtcCallSession: forward onRenegotiationNeeded to a callback
- CallController: create and send renegotiation offers, handle
incoming renegotiation offers by creating answers
- CallManager: route CallRenegotiateEvent, allow CallAnswerEvent
during Connected state for renegotiation answers
https://claude.ai/code/session_01WdmqktFBjXKB6PYRZ5b4FD
- Add case-insensitive role matching in ParticipantTag (accepts both
"host" and "Host" from other clients per NIP-53 spec)
- Add PARTICIPANT role to ROLE enum per NIP-53 spec
- Add MeetingSpaceEvent (30312), MeetingRoomEvent (30313), and
MeetingRoomPresenceEvent (10312) consumption in LocalCache
- Create rendering composables for MeetingSpaceEvent and MeetingRoomEvent
with status flags (OPEN/PRIVATE/CLOSED for spaces, LIVE/PLANNED/ENDED
for rooms) and participant display
- Add meeting kinds to all discovery feed relay filters (global, authors,
hashtag, geohash, community)
- Add meeting kinds to ChannelCardCompose and LiveActivityCard thumb
rendering
- Add meeting kinds to KindRegistry search aliases
https://claude.ai/code/session_01CJ6xfY9gRA1c5r4T1SrUuv
1. Move UI toggle state out of CallState.Connected:
- Removed isAudioMuted/isVideoEnabled/isSpeakerOn from domain
CallState. These are UI concerns, not call state.
- Added StateFlows for toggles in CallController (isAudioMuted,
isVideoEnabled, isSpeakerOn) with proper toggle methods.
- CallScreen reads toggle state from CallController flows.
- Removed toggleAudioMute/toggleVideo/toggleSpeaker from
CallManager (no longer manages UI state).
2. Move ICE candidate parsing to quartz layer:
- Added candidateSdp(), sdpMid(), sdpMLineIndex() parsers and
serializeCandidate() to CallIceCandidateEvent in quartz.
- Removed companion object with parseIceCandidate/
serializeIceCandidate from CallController.
- CallController now uses quartz-layer parsing directly.
- Updated IceCandidateSerializationTest accordingly.
3. Add helper methods to CallManager:
- currentCallId() and currentPeerPubKey() extract from any
active state, reducing repeated when expressions.
4. Fix empty callId bug in ChatroomScreen:
- Navigation to ActiveCall now uses callManager.currentCallId()
instead of hardcoded empty string.
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
Temporary diagnostic logging to identify why calls hang at
Connecting. Logs added to:
- CallManager.onSignalingEvent: event kind, age, state
- CallController: answer received, ICE candidates (buffered vs
direct), flush count, local ICE generation
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
- Change EXPIRATION_SECONDS from 300 to 20 for all call signaling
events (offer, answer, ICE, hangup, reject, renegotiate)
- Change MAX_EVENT_AGE_SECONDS from 30 to 20 to match
- Update NIP-AC doc accordingly
- Fix SecurityException crash on SDK 36: phoneCall foreground service
type requires MANAGE_OWN_CALLS permission. Switch to microphone
type which only needs RECORD_AUDIO (already granted).
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
- Deduplicate signaling events via processedEventIds set in
CallManager to prevent duplicate processing from multiple relays
- BackHandler on CallScreen calls hangup() before navigating back
- KeepScreenOn composable adds FLAG_KEEP_SCREEN_ON during calls
and clears it on dispose
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
Two fixes for call connectivity:
1. ICE candidate buffering: Candidates arriving before the WebRTC
session exists (callee ringing) or before remote description is
set (caller waiting for answer) are now queued in
pendingIceCandidates and flushed once setRemoteDescription is
called. This was the root cause of calls getting stuck at
"Connecting" — ICE candidates were silently dropped.
2. Stale event filter: All signaling events older than 30 seconds
are discarded in CallManager.onSignalingEvent() to prevent
old cached events from triggering phantom calls.
Also: removed cleanup() from WebRTC onDisconnected callback to
avoid double-cleanup race with the CallManager state observer.
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
CallManager now auto-resets from Ended to Idle after 2 seconds via
transitionToEnded(). Previously reset() was called from a
LaunchedEffect in CallScreen which could be cancelled when the
composable was disposed via popBack(), leaving the state stuck at
Ended and silently dropping subsequent incoming calls.
Also: CallController now observes CallManager state and auto-cleans
up the WebRTC session when a call ends (handles peer hangup case).
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
Connects all call infrastructure so calls flow through the system:
- EventProcessor routes unwrapped call events (offer/answer/ICE/
hangup/reject) from gift wraps to CallManager
- CallController orchestrates WebRTC session lifecycle: creates
PeerConnection, generates SDP offers/answers, exchanges ICE
candidates via gift-wrapped events, and manages foreground service
- AccountViewModel initializes CallManager + CallController and
wires answer/ICE callbacks between them
- Account.publishCallSignaling() publishes gift-wrapped events
- DM chat top bar gets a call button (1-on-1 rooms only) that
initiates a voice call and navigates to ActiveCall screen
- ActiveCall route registered in AppNavigation with CallScreen
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
Implements P2P calling over Nostr relays using WebRTC for media
transport and NIP-59 Gift Wraps for encrypted signaling. No custom
server required — only public STUN servers for NAT traversal.
Protocol layer (quartz/nip100WebRtcCalls):
- 6 new event kinds (25050-25055): offer, answer, ICE candidate,
hangup, reject, renegotiate
- WebRtcCallFactory for creating and gift-wrapping signaling events
- CallIdTag and CallTypeTag for event metadata
- Events registered in EventFactory
Call state machine (commons/call):
- CallState sealed interface with full lifecycle states
- CallManager orchestrating signaling and state transitions
- Follow-gate spam prevention: only followed users can ring,
non-follows are silently ignored
Android WebRTC integration (amethyst/service/call):
- WebRtcCallSession wrapping Google WebRTC PeerConnection
- CallForegroundService for keeping calls alive in background
- IceServerConfig with default public STUN servers
- User-configurable TURN server support
Android UI (amethyst/ui/call):
- CallScreen with offering, connecting, connected, and ended states
- IncomingCallUI with accept/reject buttons
- ConnectedCallUI with mute, video toggle, speaker, and timer
- Call button added to 1-on-1 DM chat header
- ActiveCall route added to navigation
https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS
Rename the existing BookmarkListEvent (kind 30001) to OldBookmarkListEvent
and create a new BookmarkListEvent with kind 10003 as per the updated spec.
- OldBookmarkListEvent (kind 30001): Kept as-is for backward compatibility,
displayed as "Old Bookmarks" in the Bookmark Lists screen
- BookmarkListEvent (kind 10003): New replaceable event, all new bookmark
operations (save/check/remove) use this kind
- Both kinds are displayed as separate items in the Bookmark Lists screen
- Old Bookmarks screen includes a "Move All to New Bookmarks" button that
migrates public bookmarks to public and private to private
- Created PrivateReplaceableTagArrayEvent base class for replaceable events
with encrypted private tags (kind 10003 is in the 10000-19999 range)
- Updated all relay filters, search queries, and profile views to fetch
both kinds
- Updated Android and Desktop modules
https://claude.ai/code/session_01U9sjQHQMVVHxYiesoXjqop
When a user hits Quote, the new post screen opens with the nostr URI
pre-filled but the cursor was at the end (after the URI). This moves
the cursor to the beginning so the user can immediately start typing
their commentary.
https://claude.ai/code/session_01RPseKC9GJ8hs3GGBR85ezw
When events share the same createdAt timestamp, the tiebreaker sort by id
must be ascending to produce a stable, deterministic order. Fixed several
locations that either had no secondary sort, used descending id sort, or
used .reversed() which incorrectly flipped both sort directions.
https://claude.ai/code/session_01RvuyPf1x9wLf2DCgsSXLGz
`equalImmutableLists` is public and uses referential equality (`===`) per element rather than structural equality (`==`). Without documentation, callers may assume normal list equality and get false negatives for value-equal but distinct instances. This is a non-obvious contract and should be documented explicitly to prevent subtle logic bugs.
Affected files: ListUtils.kt
Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
- Extract private log() helper in JVM and iOS PlatformLog to reduce
copy-paste branching
- Fix JVM formatter to be private and non-nullable
- Convert 60+ interpolated Log.w/e/i calls to lambda overloads,
including hot-path Filter.kt toJson() and LocalCache event processing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Defers string construction until after the level check, avoiding
allocation when debug logging is filtered in release/benchmark builds.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrates all new post screens from the old BasicTextField(TextFieldValue)
to the new BasicTextField(TextFieldState) API, which properly sets
EditorInfo.contentMimeTypes to enable GIF keyboard input.
Key changes:
- Add TextFieldState-based ThinPaddingTextField overload (keep old for readonly dropdowns)
- Create UrlUserTagOutputTransformation for the new OutputTransformation API
- Create TextFieldState extension functions (insertUrlAtCursor, replaceCurrentWord, currentWord)
- Update IMessageField interface to use TextFieldState + onMessageChanged()
- Migrate all IMessageField implementors: ChannelNewMessageViewModel,
ChatNewMessageViewModel, NewProductViewModel, NewPublicMessageViewModel,
CommentPostViewModel, ShortNotePostViewModel, LongFormPostViewModel
- Update PreviewState to accept String instead of TextFieldValue
- Add TextFieldState overload to UserSuggestionState.replaceCurrentWord()
- Update all post screen call sites
https://claude.ai/code/session_01FDGf1Zi1pVvzFi3JY5agnJ
Reverts three naming changes from the previous refactor:
- Interface stays INostrClient (not NostrClient)
- Class stays NostrClient (not DefaultNostrClient)
- onEose stays onEose (not onCaughtUp)
- isLive stays isLive (not isRealTime)
All other renames from the API simplification are preserved:
subscribe, unsubscribe, publish, count, fetchAll, fetchFirst, etc.
https://claude.ai/code/session_01JPcYCcRx5eZN4GvgGxGwbf
- Move BookmarkListState from amethyst/ to commons/commonMain/
- Change cache param from LocalCache to ICacheProvider
- Android file becomes typealias to commons version
- No settings or decryptionCache dependencies (simplest State class)
- Pins bookmarkList AddressableNote via strong ref for GC retention
- Move LargeSoftCache from amethyst/model to commons/jvmAndroid/model/cache
so both Android and Desktop share the same WeakReference cache implementation
- Change ICacheProvider return types from Any? to proper types (User?, Note?)
since these model classes already live in commons
- Remove unnecessary casts in ThreadAssembler, ChatNewMessageState, SearchBarState
- Improve LargeSoftCache.cleanUp() to use single-pass iterator (zero allocation)
- Update Android imports in LocalCache, LargeSoftCacheAddressExt, and test
Per Vitor's feedback on PR #1905: BoundedLargeCache evicts arbitrarily.
LargeSoftCache uses WeakReferences so GC respects the reference graph.