2.1 KiB
2.1 KiB
Direct Call Domain
Direct calls coordinate private voice sessions started from people cards, direct-message headers, or active-call rail icons. The domain owns call session state and call-control events; media capture, camera, screen sharing, playback, and voice activity stay in the existing voice and screen-share domains.
Flow
DirectCallService.startCall()creates or reuses the direct-message conversation for a peer, whilestartConversationCall()starts from an existing one-to-one or group conversation. Both paths reuse a live call for the same peer or group before creating a new session.- The caller joins a call-scoped voice session and sends a
direct-callring event throughPeerDeliveryService. Joining a direct call first leaves any other joined call or server voice channel. - The recipient stores the incoming session, loops
assets/audio/call.wav, and shows a desktop notification when permission allows. The ring stops when the recipient joins, leaves, or the call ends. - Opening
/call/:callIdshows the private call surface with portraits, voice indicators, media controls, screen/camera tiles, add-user control, and a narrow DM chat panel. - If a third participant is invited, the call creates a fresh empty group conversation and switches the call chat panel to it. Existing one-to-one messages stay in the original PM and are not copied into the group chat.
- Starting a call from a group chat uses the group conversation id as the call id and rings every other participant.
- Joining, leaving, ending, participant additions, and call chat conversion updates are mirrored as
direct-callevents over the same P2P/signaling fallback path used by direct messages. - The server rail shows call icons only while at least one participant is joined. If a user is viewing a private call after the session ends, the route returns to the call's chat view.
Two-person calls use the one-to-one direct-message conversation id as their call id. Converted group calls keep the original call id for media routing but point conversationId at the new group chat so active streams stay connected while the chat history boundary changes.