1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use crate::raw::base;
/// A privacy setting whose audience the account can change.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum PrivacyKey {
/// Who can see the account's phone number.
PhoneNumber,
/// Who can find the account by its phone number.
AddedByPhone,
/// Who can see when the account was last online.
LastSeen,
/// Who can see the account's profile photo.
ProfilePhoto,
/// Who can link to the account when forwarding its messages.
Forwards,
/// Who can call the account.
PhoneCall,
/// Who can make peer-to-peer connections in calls with the account.
PhoneP2P,
/// Who can add the account to groups and channels.
ChatInvite,
/// Who can send the account voice messages.
VoiceMessages,
/// Who can see the account's bio.
Bio,
/// Who can see the account's birthday.
Birthday,
/// Who can send the account gifts that are saved to its profile automatically.
Gifts,
/// Who can message the account without paying.
NoPaidMessages,
/// Who can see the music saved to the account's profile.
SavedMusic,
}
impl PrivacyKey {
pub(crate) fn write(self) -> base::InputPrivacyKey {
use base::InputPrivacyKey as K;
match self {
PrivacyKey::PhoneNumber => K::InputPrivacyKeyPhoneNumber,
PrivacyKey::AddedByPhone => K::InputPrivacyKeyAddedByPhone,
PrivacyKey::LastSeen => K::InputPrivacyKeyStatusTimestamp,
PrivacyKey::ProfilePhoto => K::InputPrivacyKeyProfilePhoto,
PrivacyKey::Forwards => K::InputPrivacyKeyForwards,
PrivacyKey::PhoneCall => K::InputPrivacyKeyPhoneCall,
PrivacyKey::PhoneP2P => K::InputPrivacyKeyPhoneP2P,
PrivacyKey::ChatInvite => K::InputPrivacyKeyChatInvite,
PrivacyKey::VoiceMessages => K::InputPrivacyKeyVoiceMessages,
PrivacyKey::Bio => K::InputPrivacyKeyAbout,
PrivacyKey::Birthday => K::InputPrivacyKeyBirthday,
PrivacyKey::Gifts => K::InputPrivacyKeyStarGiftsAutoSave,
PrivacyKey::NoPaidMessages => K::InputPrivacyKeyNoPaidMessages,
PrivacyKey::SavedMusic => K::InputPrivacyKeySavedMusic,
}
}
}