2 schema::{user_, user_alias_1, user_alias_2},
7 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
8 #[table_name = "user_"]
12 pub preferred_username: Option<String>,
13 pub password_encrypted: String,
14 pub email: Option<String>,
15 pub avatar: Option<String>,
18 pub published: chrono::NaiveDateTime,
19 pub updated: Option<chrono::NaiveDateTime>,
22 pub default_sort_type: i16,
23 pub default_listing_type: i16,
25 pub show_avatars: bool,
26 pub send_notifications_to_email: bool,
27 pub matrix_user_id: Option<String>,
29 pub bio: Option<String>,
31 pub private_key: Option<String>,
32 pub public_key: Option<String>,
33 pub last_refreshed_at: chrono::NaiveDateTime,
34 pub banner: Option<String>,
37 pub shared_inbox_url: Option<Url>,
38 pub validator_time: chrono::NaiveDateTime,
41 /// A safe representation of user, without the sensitive info
42 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
43 #[table_name = "user_"]
47 pub preferred_username: Option<String>,
48 pub avatar: Option<String>,
51 pub published: chrono::NaiveDateTime,
52 pub updated: Option<chrono::NaiveDateTime>,
53 pub matrix_user_id: Option<String>,
55 pub bio: Option<String>,
57 pub banner: Option<String>,
60 pub shared_inbox_url: Option<Url>,
63 /// A safe user view with only settings
64 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
65 #[table_name = "user_"]
66 pub struct UserSafeSettings {
69 pub preferred_username: Option<String>,
70 pub email: Option<String>,
71 pub avatar: Option<String>,
74 pub published: chrono::NaiveDateTime,
75 pub updated: Option<chrono::NaiveDateTime>,
78 pub default_sort_type: i16,
79 pub default_listing_type: i16,
81 pub show_avatars: bool,
82 pub send_notifications_to_email: bool,
83 pub matrix_user_id: Option<String>,
85 pub bio: Option<String>,
87 pub last_refreshed_at: chrono::NaiveDateTime,
88 pub banner: Option<String>,
90 pub validator_time: chrono::NaiveDateTime,
93 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
94 #[table_name = "user_alias_1"]
95 pub struct UserAlias1 {
98 pub preferred_username: Option<String>,
99 pub password_encrypted: String,
100 pub email: Option<String>,
101 pub avatar: Option<String>,
104 pub published: chrono::NaiveDateTime,
105 pub updated: Option<chrono::NaiveDateTime>,
108 pub default_sort_type: i16,
109 pub default_listing_type: i16,
111 pub show_avatars: bool,
112 pub send_notifications_to_email: bool,
113 pub matrix_user_id: Option<String>,
115 pub bio: Option<String>,
117 pub private_key: Option<String>,
118 pub public_key: Option<String>,
119 pub last_refreshed_at: chrono::NaiveDateTime,
120 pub banner: Option<String>,
124 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
125 #[table_name = "user_alias_1"]
126 pub struct UserSafeAlias1 {
129 pub preferred_username: Option<String>,
130 pub avatar: Option<String>,
133 pub published: chrono::NaiveDateTime,
134 pub updated: Option<chrono::NaiveDateTime>,
135 pub matrix_user_id: Option<String>,
137 pub bio: Option<String>,
139 pub banner: Option<String>,
143 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
144 #[table_name = "user_alias_2"]
145 pub struct UserAlias2 {
148 pub preferred_username: Option<String>,
149 pub password_encrypted: String,
150 pub email: Option<String>,
151 pub avatar: Option<String>,
154 pub published: chrono::NaiveDateTime,
155 pub updated: Option<chrono::NaiveDateTime>,
158 pub default_sort_type: i16,
159 pub default_listing_type: i16,
161 pub show_avatars: bool,
162 pub send_notifications_to_email: bool,
163 pub matrix_user_id: Option<String>,
165 pub bio: Option<String>,
167 pub private_key: Option<String>,
168 pub public_key: Option<String>,
169 pub last_refreshed_at: chrono::NaiveDateTime,
170 pub banner: Option<String>,
174 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
175 #[table_name = "user_alias_2"]
176 pub struct UserSafeAlias2 {
179 pub preferred_username: Option<String>,
180 pub avatar: Option<String>,
183 pub published: chrono::NaiveDateTime,
184 pub updated: Option<chrono::NaiveDateTime>,
185 pub matrix_user_id: Option<String>,
187 pub bio: Option<String>,
189 pub banner: Option<String>,
193 #[derive(Insertable, AsChangeset, Clone)]
194 #[table_name = "user_"]
195 pub struct UserForm {
197 pub preferred_username: Option<Option<String>>,
198 pub password_encrypted: String,
200 pub banned: Option<bool>,
201 pub email: Option<Option<String>>,
202 pub avatar: Option<Option<String>>,
203 pub published: Option<chrono::NaiveDateTime>,
204 pub updated: Option<chrono::NaiveDateTime>,
207 pub default_sort_type: i16,
208 pub default_listing_type: i16,
210 pub show_avatars: bool,
211 pub send_notifications_to_email: bool,
212 pub matrix_user_id: Option<Option<String>>,
213 pub actor_id: Option<Url>,
214 pub bio: Option<Option<String>>,
216 pub private_key: Option<String>,
217 pub public_key: Option<String>,
218 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
219 pub banner: Option<Option<String>>,
220 pub inbox_url: Option<Url>,
221 pub shared_inbox_url: Option<Option<Url>>,