Send Presence Update
Let contacts know whether you’re online, offline, typing, recording audio, or viewing their status.Basic Usage
WAPresence Types
Thepresence parameter can be one of the following WAPresence values:
'unavailable'- Offline/not available'available'- Online/available'composing'- Typing a message'recording'- Recording audio message'paused'- Stopped typing (treated as available)
The presence expires after about 10 seconds. You need to send periodic updates to maintain an active presence state.
Update Your Global Presence
To update your overall online/offline status:Send Typing Indicator
Let the other person know you’re typing in their chat:Send Recording Indicator
Show that you’re recording an audio message:Subscribe to Presence Updates
To receive presence updates from a contact or group:Listen for Presence Updates
Receive notifications when contacts change their presence:Push Notifications
Implementation Details
ThesendPresenceUpdate function is implemented in src/Socket/chats.ts:684-724:
- For
available/unavailable: Sends a global presence update - For
composing/recording/paused: Sends a chatstate update to specific JID - Automatically handles LID (Lightweight Identity) for supported users
- Recording presence is sent as composing with media type ‘audio’
The function automatically replaces ’@’ symbols in your display name when sending presence updates.