Fetch Privacy Settings
Retrieve all current privacy settings for your account:Pass
true to force refresh the settings, or false to use cached values. The function is implemented in src/Socket/chats.ts:119-134.Privacy Value Types
Most privacy settings accept these values:'all'- Everyone can see'contacts'- Only your contacts can see'contact_blacklist'- Contacts except blocked ones'none'- Nobody can see
Update Last Seen Privacy
Control who can see when you were last online:Update Online Privacy
Control who can see when you’re online:Online privacy has two options:
'all' or 'match_last_seen' (same as last seen setting).Update Profile Picture Privacy
Control who can see your profile picture:Update Status Privacy
Control who can see your WhatsApp status/about:Update Read Receipts Privacy
Control whether you send read receipts (blue ticks):Update Groups Add Privacy
Control who can add you to groups:Groups add privacy only supports
'all', 'contacts', or 'contact_blacklist'. The 'none' option is not available.Update Default Disappearing Mode
Set the default duration for disappearing messages in new chats:Supported Times
| Time | Seconds |
|---|---|
| Remove | 0 |
| 24h | 86,400 |
| 7d | 604,800 |
| 90d | 7,776,000 |
Example
Privacy Functions Reference
All privacy update functions are implemented insrc/Socket/chats.ts:
| Function | Line | Description |
|---|---|---|
fetchPrivacySettings | 119-134 | Fetch all privacy settings |
updateLastSeenPrivacy | 168-170 | Update last seen visibility |
updateOnlinePrivacy | 172-174 | Update online status visibility |
updateProfilePicturePrivacy | 176-178 | Update profile picture visibility |
updateStatusPrivacy | 180-182 | Update status/about visibility |
updateReadReceiptsPrivacy | 184-186 | Update read receipt settings |
updateGroupsAddPrivacy | 188-190 | Update who can add to groups |
updateDefaultDisappearingMode | 192-209 | Update default disappearing messages |
Complete Example
All privacy functions use the internal
privacyQuery helper which sends IQ queries to WhatsApp servers with the appropriate XML namespace.