|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
use crate::{
|
|
|
|
|
schema::{user_, user_alias_1, user_alias_2},
|
|
|
|
|
Url,
|
|
|
|
|
DbUrl,
|
|
|
|
|
};
|
|
|
|
|
use serde::Serialize;
|
|
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ pub struct User_ {
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub password_encrypted: String,
|
|
|
|
|
pub email: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
@ -25,16 +25,16 @@ pub struct User_ {
|
|
|
|
|
pub show_avatars: bool,
|
|
|
|
|
pub send_notifications_to_email: bool,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub private_key: Option<String>,
|
|
|
|
|
pub public_key: Option<String>,
|
|
|
|
|
pub last_refreshed_at: chrono::NaiveDateTime,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
pub inbox_url: Url,
|
|
|
|
|
pub shared_inbox_url: Option<Url>,
|
|
|
|
|
pub inbox_url: DbUrl,
|
|
|
|
|
pub shared_inbox_url: Option<DbUrl>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A safe representation of user, without the sensitive info
|
|
|
|
@ -44,19 +44,19 @@ pub struct UserSafe {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
pub inbox_url: Url,
|
|
|
|
|
pub shared_inbox_url: Option<Url>,
|
|
|
|
|
pub inbox_url: DbUrl,
|
|
|
|
|
pub shared_inbox_url: Option<DbUrl>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A safe user view with only settings
|
|
|
|
@ -67,7 +67,7 @@ pub struct UserSafeSettings {
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub email: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
@ -80,11 +80,11 @@ pub struct UserSafeSettings {
|
|
|
|
|
pub show_avatars: bool,
|
|
|
|
|
pub send_notifications_to_email: bool,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub last_refreshed_at: chrono::NaiveDateTime,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ pub struct UserAlias1 {
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub password_encrypted: String,
|
|
|
|
|
pub email: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
@ -109,13 +109,13 @@ pub struct UserAlias1 {
|
|
|
|
|
pub show_avatars: bool,
|
|
|
|
|
pub send_notifications_to_email: bool,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub private_key: Option<String>,
|
|
|
|
|
pub public_key: Option<String>,
|
|
|
|
|
pub last_refreshed_at: chrono::NaiveDateTime,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -125,16 +125,16 @@ pub struct UserSafeAlias1 {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -146,7 +146,7 @@ pub struct UserAlias2 {
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub password_encrypted: String,
|
|
|
|
|
pub email: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
@ -159,13 +159,13 @@ pub struct UserAlias2 {
|
|
|
|
|
pub show_avatars: bool,
|
|
|
|
|
pub send_notifications_to_email: bool,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub private_key: Option<String>,
|
|
|
|
|
pub public_key: Option<String>,
|
|
|
|
|
pub last_refreshed_at: chrono::NaiveDateTime,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -175,16 +175,16 @@ pub struct UserSafeAlias2 {
|
|
|
|
|
pub id: i32,
|
|
|
|
|
pub name: String,
|
|
|
|
|
pub preferred_username: Option<String>,
|
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
pub avatar: Option<DbUrl>,
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: bool,
|
|
|
|
|
pub published: chrono::NaiveDateTime,
|
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
|
|
|
pub matrix_user_id: Option<String>,
|
|
|
|
|
pub actor_id: Url,
|
|
|
|
|
pub actor_id: DbUrl,
|
|
|
|
|
pub bio: Option<String>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub banner: Option<String>,
|
|
|
|
|
pub banner: Option<DbUrl>,
|
|
|
|
|
pub deleted: bool,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -197,7 +197,7 @@ pub struct UserForm {
|
|
|
|
|
pub admin: bool,
|
|
|
|
|
pub banned: Option<bool>,
|
|
|
|
|
pub email: Option<Option<String>>,
|
|
|
|
|
pub avatar: Option<Option<String>>,
|
|
|
|
|
pub avatar: Option<Option<DbUrl>>,
|
|
|
|
|
pub published: Option<chrono::NaiveDateTime>,
|
|
|
|
|
pub updated: Option<chrono::NaiveDateTime>,
|
|
|
|
|
pub show_nsfw: bool,
|
|
|
|
@ -208,13 +208,13 @@ pub struct UserForm {
|
|
|
|
|
pub show_avatars: bool,
|
|
|
|
|
pub send_notifications_to_email: bool,
|
|
|
|
|
pub matrix_user_id: Option<Option<String>>,
|
|
|
|
|
pub actor_id: Option<Url>,
|
|
|
|
|
pub actor_id: Option<DbUrl>,
|
|
|
|
|
pub bio: Option<Option<String>>,
|
|
|
|
|
pub local: bool,
|
|
|
|
|
pub private_key: Option<String>,
|
|
|
|
|
pub public_key: Option<String>,
|
|
|
|
|
pub last_refreshed_at: Option<chrono::NaiveDateTime>,
|
|
|
|
|
pub banner: Option<Option<String>>,
|
|
|
|
|
pub inbox_url: Option<Url>,
|
|
|
|
|
pub shared_inbox_url: Option<Option<Url>>,
|
|
|
|
|
pub banner: Option<Option<DbUrl>>,
|
|
|
|
|
pub inbox_url: Option<DbUrl>,
|
|
|
|
|
pub shared_inbox_url: Option<Option<DbUrl>>,
|
|
|
|
|
}
|
|
|
|
|