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>,
38 /// A safe representation of user, without the sensitive info
39 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
40 #[table_name = "user_"]
44 pub preferred_username: Option<String>,
45 pub avatar: Option<String>,
48 pub published: chrono::NaiveDateTime,
49 pub updated: Option<chrono::NaiveDateTime>,
50 pub matrix_user_id: Option<String>,
52 pub bio: Option<String>,
54 pub banner: Option<String>,
58 /// A safe user view with only settings
59 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
60 #[table_name = "user_"]
61 pub struct UserSafeSettings {
64 pub preferred_username: Option<String>,
65 pub email: Option<String>,
66 pub avatar: Option<String>,
69 pub published: chrono::NaiveDateTime,
70 pub updated: Option<chrono::NaiveDateTime>,
73 pub default_sort_type: i16,
74 pub default_listing_type: i16,
76 pub show_avatars: bool,
77 pub send_notifications_to_email: bool,
78 pub matrix_user_id: Option<String>,
80 pub bio: Option<String>,
82 pub last_refreshed_at: chrono::NaiveDateTime,
83 pub banner: Option<String>,
87 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
88 #[table_name = "user_alias_1"]
89 pub struct UserAlias1 {
92 pub preferred_username: Option<String>,
93 pub password_encrypted: String,
94 pub email: Option<String>,
95 pub avatar: Option<String>,
98 pub published: chrono::NaiveDateTime,
99 pub updated: Option<chrono::NaiveDateTime>,
102 pub default_sort_type: i16,
103 pub default_listing_type: i16,
105 pub show_avatars: bool,
106 pub send_notifications_to_email: bool,
107 pub matrix_user_id: Option<String>,
109 pub bio: Option<String>,
111 pub private_key: Option<String>,
112 pub public_key: Option<String>,
113 pub last_refreshed_at: chrono::NaiveDateTime,
114 pub banner: Option<String>,
118 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
119 #[table_name = "user_alias_1"]
120 pub struct UserSafeAlias1 {
123 pub preferred_username: Option<String>,
124 pub avatar: Option<String>,
127 pub published: chrono::NaiveDateTime,
128 pub updated: Option<chrono::NaiveDateTime>,
129 pub matrix_user_id: Option<String>,
131 pub bio: Option<String>,
133 pub banner: Option<String>,
137 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
138 #[table_name = "user_alias_2"]
139 pub struct UserAlias2 {
142 pub preferred_username: Option<String>,
143 pub password_encrypted: String,
144 pub email: Option<String>,
145 pub avatar: Option<String>,
148 pub published: chrono::NaiveDateTime,
149 pub updated: Option<chrono::NaiveDateTime>,
152 pub default_sort_type: i16,
153 pub default_listing_type: i16,
155 pub show_avatars: bool,
156 pub send_notifications_to_email: bool,
157 pub matrix_user_id: Option<String>,
159 pub bio: Option<String>,
161 pub private_key: Option<String>,
162 pub public_key: Option<String>,
163 pub last_refreshed_at: chrono::NaiveDateTime,
164 pub banner: Option<String>,
168 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
169 #[table_name = "user_alias_2"]
170 pub struct UserSafeAlias2 {
173 pub preferred_username: Option<String>,
174 pub avatar: Option<String>,
177 pub published: chrono::NaiveDateTime,
178 pub updated: Option<chrono::NaiveDateTime>,
179 pub matrix_user_id: Option<String>,
181 pub bio: Option<String>,
183 pub banner: Option<String>,
187 #[derive(Insertable, AsChangeset, Clone)]
188 #[table_name = "user_"]
189 pub struct UserForm {
191 pub preferred_username: Option<Option<String>>,
192 pub password_encrypted: String,
194 pub banned: Option<bool>,
195 pub email: Option<Option<String>>,
196 pub avatar: Option<Option<String>>,
197 pub published: Option<chrono::NaiveDateTime>,
198 pub updated: Option<chrono::NaiveDateTime>,
201 pub default_sort_type: i16,
202 pub default_listing_type: i16,
204 pub show_avatars: bool,
205 pub send_notifications_to_email: bool,
206 pub matrix_user_id: Option<Option<String>>,
207 pub actor_id: Option<Url>,
208 pub bio: Option<Option<String>>,
210 pub private_key: Option<String>,
211 pub public_key: Option<String>,
212 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
213 pub banner: Option<Option<String>>,