privchat_protocol/rpc/account/
privacy.rs1use serde::{Deserialize, Serialize};
20
21#[derive(Debug, Clone, Serialize, Deserialize)]
25pub struct AccountPrivacyGetRequest {
26 #[serde(skip_deserializing, default)]
28 pub user_id: u64,
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize)]
35pub struct AccountPrivacyUpdateRequest {
36 #[serde(skip_serializing_if = "Option::is_none")]
38 pub allow_add_by_group: Option<bool>,
39 #[serde(skip_serializing_if = "Option::is_none")]
41 pub allow_search_by_phone: Option<bool>,
42 #[serde(skip_serializing_if = "Option::is_none")]
44 pub allow_search_by_username: Option<bool>,
45 #[serde(skip_serializing_if = "Option::is_none")]
47 pub allow_search_by_email: Option<bool>,
48 #[serde(skip_serializing_if = "Option::is_none")]
50 pub allow_search_by_qrcode: Option<bool>,
51 #[serde(skip_serializing_if = "Option::is_none")]
53 pub allow_view_by_non_friend: Option<bool>,
54 #[serde(skip_serializing_if = "Option::is_none")]
56 pub allow_receive_message_from_non_friend: Option<bool>,
57
58 #[serde(skip_deserializing, default)]
60 pub user_id: u64,
61}
62
63#[derive(Debug, Clone, Serialize, Deserialize)]
67pub struct AccountPrivacySettings {
68 pub user_id: u64,
69 pub allow_add_by_group: bool,
70 pub allow_search_by_phone: bool,
71 pub allow_search_by_username: bool,
72 pub allow_search_by_email: bool,
73 pub allow_search_by_qrcode: bool,
74 pub allow_view_by_non_friend: bool,
75 pub allow_receive_message_from_non_friend: bool,
76 pub updated_at: String,
77}
78
79#[derive(Debug, Clone, Serialize, Deserialize)]
83pub struct AccountPrivacyGetResponse {
84 pub user_id: u64,
85 pub allow_add_by_group: bool,
86 pub allow_search_by_phone: bool,
87 pub allow_search_by_username: bool,
88 pub allow_search_by_email: bool,
89 pub allow_search_by_qrcode: bool,
90 pub allow_view_by_non_friend: bool,
91 pub allow_receive_message_from_non_friend: bool,
92 pub updated_at: String,
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
99pub struct AccountPrivacyUpdateResponse {
100 pub success: bool,
101 pub user_id: u64,
102 pub message: String,
103 pub allow_add_by_group: bool,
104 pub allow_search_by_phone: bool,
105 pub allow_search_by_username: bool,
106 pub allow_search_by_email: bool,
107 pub allow_search_by_qrcode: bool,
108 pub allow_view_by_non_friend: bool,
109 pub allow_receive_message_from_non_friend: bool,
110 pub updated_at: String,
111}