mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
33
crates/core/models/src/v0/emojis.rs
Normal file
33
crates/core/models/src/v0/emojis.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
auto_derived!(
|
||||
/// Emoji
|
||||
pub struct Emoji {
|
||||
/// Unique Id
|
||||
#[cfg_attr(feature = "serde", serde(rename = "_id"))]
|
||||
pub id: String,
|
||||
/// What owns this emoji
|
||||
pub parent: EmojiParent,
|
||||
/// Uploader user id
|
||||
pub creator_id: String,
|
||||
/// Emoji name
|
||||
pub name: String,
|
||||
/// Whether the emoji is animated
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
serde(skip_serializing_if = "crate::if_false", default)
|
||||
)]
|
||||
pub animated: bool,
|
||||
/// Whether the emoji is marked as nsfw
|
||||
#[cfg_attr(
|
||||
feature = "serde",
|
||||
serde(skip_serializing_if = "crate::if_false", default)
|
||||
)]
|
||||
pub nsfw: bool,
|
||||
}
|
||||
|
||||
/// Parent Id of the emoji
|
||||
#[serde(tag = "type")]
|
||||
pub enum EmojiParent {
|
||||
Server { id: String },
|
||||
Detached,
|
||||
}
|
||||
);
|
||||
@@ -3,9 +3,11 @@ mod channel_invites;
|
||||
mod channel_unreads;
|
||||
mod channel_webhooks;
|
||||
mod channels;
|
||||
mod emojis;
|
||||
mod files;
|
||||
mod server_members;
|
||||
mod servers;
|
||||
mod user_settings;
|
||||
mod users;
|
||||
|
||||
pub use bots::*;
|
||||
@@ -13,7 +15,9 @@ pub use channel_invites::*;
|
||||
pub use channel_unreads::*;
|
||||
pub use channel_webhooks::*;
|
||||
pub use channels::*;
|
||||
pub use emojis::*;
|
||||
pub use files::*;
|
||||
pub use server_members::*;
|
||||
pub use servers::*;
|
||||
pub use user_settings::*;
|
||||
pub use users::*;
|
||||
|
||||
6
crates/core/models/src/v0/user_settings.rs
Normal file
6
crates/core/models/src/v0/user_settings.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
/// HashMap of user settings
|
||||
/// Each key is mapped to a tuple consisting of the
|
||||
/// revision timestamp and serialised data (in JSON format)
|
||||
pub type UserSettings = HashMap<String, (i64, String)>;
|
||||
Reference in New Issue
Block a user