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
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.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.
| Category | Valid values |
|---|---|
Last | All, Contacts, ContactBlacklist, None |
Online | All, MatchLastSeen |
Profile | All, Contacts, ContactBlacklist, None |
Status | All, Contacts, ContactBlacklist, None |
GroupAdd | All, Contacts, ContactBlacklist, None |
ReadReceipts | All, None |
CallAdd | All, Known, Contacts |
Messages | All, Contacts |
DefenseMode | Off, OnStandard |
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
- TC Token API - Trusted contact tokens used for privacy-gated operations
- Blocking API - Block and unblock contacts