Access
Privacy operations are available directly on theClient:
Methods
fetch_privacy_settings
Fetch all current privacy settings.PrivacySettingsResponse- Contains a list of all privacy settings
The client also fetches privacy settings automatically in the background right after connecting, purely to keep an internal cache current. Today the only setting cached this way is
ReadReceipts, which gates the wire type of outgoing DM read/played receipts (see Read receipt privacy gating). That cache is written only by the automatic background fetch on connect — calling fetch_privacy_settings yourself is a bare passthrough that returns the current server-side values without touching device state, so it does not also refresh the cache. Call it directly when you need the full, current set of values, e.g. to render a settings screen; a reconnect (not a manual call) is what updates the cached read-receipts gate.set_privacy_setting
Update a specific privacy setting.category- APrivacyCategoryenum variantvalue- APrivacyValueenum variant (must be valid for the category)
SetPrivacySettingResponse- Contains an optionaldhashfield (present only forContactBlacklistoperations)
Each
PrivacyCategory only accepts specific PrivacyValue variants. See the valid combinations table below.Setting
ReadReceipts to None takes effect on the next connect (the client re-fetches and re-caches the setting on each connect, matching WhatsApp Web, which reads it from local prefs) — calling fetch_privacy_settings yourself in the same session does not refresh that cache either (see the note above); a reconnect is currently the only way. From then on, mark_as_read/mark_as_played on a direct message send read-self/played-self instead of read/played, so the other party is no longer notified. This only applies to DMs — group, broadcast list, status-broadcast, and newsletter receipts are unaffected. See Read receipt privacy gating.set_privacy_disallowed_list
Update a privacy category’s disallowed list (contacts-except-specific-users mode). Only available for categories that supportContactBlacklist: Last, Profile, Status, and GroupAdd.
category- Must beLast,Profile,Status, orGroupAddupdate- ADisallowedListUpdatecontaining thedhashand user entries to add/remove
SetPrivacySettingResponse- Contains the updateddhashfor conflict detection
set_default_disappearing_mode
Set the default disappearing messages duration for all new chats.duration- Timer in seconds. Common values:86400(24 hours),604800(7 days),7776000(90 days). Pass0to disable.
This sets the default for new chats only. Existing chats keep their current setting. To change disappearing messages for a specific group, use
set_ephemeral.Types
PrivacyCategory
Controls which privacy setting is being read or written. Each category maps to a wire-protocol string value.PrivacyValue
The value assigned to a privacy category.Valid category-value combinations
Not all values are valid for every category. UsePrivacyCategory::is_valid_value() to check at runtime.
PrivacySetting
PrivacySettingsResponse
get(&self, category: &PrivacyCategory) -> Option<&PrivacySetting>- Look up a setting by categoryget_value(&self, category: &PrivacyCategory) -> Option<&PrivacyValue>- Look up a value directly
SetPrivacySettingResponse
dhash field is populated when setting a ContactBlacklist value or updating a disallowed list. Use it for conflict detection on subsequent updates.
DisallowedListUpdate
Used withset_privacy_disallowed_list to add or remove users from a category’s disallowed list.
DisallowedListUserEntry
DisallowedListAction
Common patterns
Fetch and display all settings
Maximum privacy configuration
Validate before setting
See also
- Client API - Client-level privacy methods
- Receipt API - How
ReadReceiptsgates DM read/played receipts - TC Token API - Trusted contact tokens used for privacy-gated operations
- Blocking API - Block and unblock contacts