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>,
40 /// A safe representation of user, without the sensitive info
41 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
42 #[table_name = "user_"]
46 pub preferred_username: Option<String>,
47 pub avatar: Option<String>,
50 pub published: chrono::NaiveDateTime,
51 pub updated: Option<chrono::NaiveDateTime>,
52 pub matrix_user_id: Option<String>,
54 pub bio: Option<String>,
56 pub banner: Option<String>,
59 pub shared_inbox_url: Option<Url>,
62 /// A safe user view with only settings
63 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
64 #[table_name = "user_"]
65 pub struct UserSafeSettings {
68 pub preferred_username: Option<String>,
69 pub email: Option<String>,
70 pub avatar: Option<String>,
73 pub published: chrono::NaiveDateTime,
74 pub updated: Option<chrono::NaiveDateTime>,
77 pub default_sort_type: i16,
78 pub default_listing_type: i16,
80 pub show_avatars: bool,
81 pub send_notifications_to_email: bool,
82 pub matrix_user_id: Option<String>,
84 pub bio: Option<String>,
86 pub last_refreshed_at: chrono::NaiveDateTime,
87 pub banner: Option<String>,
91 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
92 #[table_name = "user_alias_1"]
93 pub struct UserAlias1 {
96 pub preferred_username: Option<String>,
97 pub password_encrypted: String,
98 pub email: Option<String>,
99 pub avatar: Option<String>,
102 pub published: chrono::NaiveDateTime,
103 pub updated: Option<chrono::NaiveDateTime>,
106 pub default_sort_type: i16,
107 pub default_listing_type: i16,
109 pub show_avatars: bool,
110 pub send_notifications_to_email: bool,
111 pub matrix_user_id: Option<String>,
113 pub bio: Option<String>,
115 pub private_key: Option<String>,
116 pub public_key: Option<String>,
117 pub last_refreshed_at: chrono::NaiveDateTime,
118 pub banner: Option<String>,
122 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
123 #[table_name = "user_alias_1"]
124 pub struct UserSafeAlias1 {
127 pub preferred_username: Option<String>,
128 pub avatar: Option<String>,
131 pub published: chrono::NaiveDateTime,
132 pub updated: Option<chrono::NaiveDateTime>,
133 pub matrix_user_id: Option<String>,
135 pub bio: Option<String>,
137 pub banner: Option<String>,
141 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
142 #[table_name = "user_alias_2"]
143 pub struct UserAlias2 {
146 pub preferred_username: Option<String>,
147 pub password_encrypted: String,
148 pub email: Option<String>,
149 pub avatar: Option<String>,
152 pub published: chrono::NaiveDateTime,
153 pub updated: Option<chrono::NaiveDateTime>,
156 pub default_sort_type: i16,
157 pub default_listing_type: i16,
159 pub show_avatars: bool,
160 pub send_notifications_to_email: bool,
161 pub matrix_user_id: Option<String>,
163 pub bio: Option<String>,
165 pub private_key: Option<String>,
166 pub public_key: Option<String>,
167 pub last_refreshed_at: chrono::NaiveDateTime,
168 pub banner: Option<String>,
172 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
173 #[table_name = "user_alias_2"]
174 pub struct UserSafeAlias2 {
177 pub preferred_username: Option<String>,
178 pub avatar: Option<String>,
181 pub published: chrono::NaiveDateTime,
182 pub updated: Option<chrono::NaiveDateTime>,
183 pub matrix_user_id: Option<String>,
185 pub bio: Option<String>,
187 pub banner: Option<String>,
191 #[derive(Insertable, AsChangeset, Clone)]
192 #[table_name = "user_"]
193 pub struct UserForm {
195 pub preferred_username: Option<Option<String>>,
196 pub password_encrypted: String,
198 pub banned: Option<bool>,
199 pub email: Option<Option<String>>,
200 pub avatar: Option<Option<String>>,
201 pub published: Option<chrono::NaiveDateTime>,
202 pub updated: Option<chrono::NaiveDateTime>,
205 pub default_sort_type: i16,
206 pub default_listing_type: i16,
208 pub show_avatars: bool,
209 pub send_notifications_to_email: bool,
210 pub matrix_user_id: Option<Option<String>>,
211 pub actor_id: Option<Url>,
212 pub bio: Option<Option<String>>,
214 pub private_key: Option<String>,
215 pub public_key: Option<String>,
216 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
217 pub banner: Option<Option<String>>,
218 pub inbox_url: Option<Url>,
219 pub shared_inbox_url: Option<Option<Url>>,