forked from jmug/stoatchat
feat: add emoji
This commit is contained in:
@@ -3,6 +3,7 @@ use crate::Result;
|
||||
|
||||
#[async_trait]
|
||||
pub trait AbstractAttachment: Sync + Send {
|
||||
/// Find an attachment by its details and mark it as used by a given parent.
|
||||
async fn find_and_use_attachment(
|
||||
&self,
|
||||
id: &str,
|
||||
@@ -10,8 +11,16 @@ pub trait AbstractAttachment: Sync + Send {
|
||||
parent_type: &str,
|
||||
parent_id: &str,
|
||||
) -> Result<File>;
|
||||
|
||||
/// Insert attachment into database.
|
||||
async fn insert_attachment(&self, attachment: &File) -> Result<()>;
|
||||
|
||||
/// Mark an attachment as having been reported.
|
||||
async fn mark_attachment_as_reported(&self, id: &str) -> Result<()>;
|
||||
|
||||
/// Mark an attachment as having been deleted.
|
||||
async fn mark_attachment_as_deleted(&self, id: &str) -> Result<()>;
|
||||
|
||||
/// Mark multiple attachments as having been deleted.
|
||||
async fn mark_attachments_as_deleted(&self, ids: &[String]) -> Result<()>;
|
||||
}
|
||||
|
||||
20
crates/quark/src/traits/media/emoji.rs
Normal file
20
crates/quark/src/traits/media/emoji.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use crate::models::Emoji;
|
||||
use crate::Result;
|
||||
|
||||
#[async_trait]
|
||||
pub trait AbstractEmoji: Sync + Send {
|
||||
/// Fetch an emoji by its id
|
||||
async fn fetch_emoji(&self, id: &str) -> Result<Emoji>;
|
||||
|
||||
/// Fetch emoji by their parent id
|
||||
async fn fetch_emoji_by_parent_id(&self, parent_id: &str) -> Result<Vec<Emoji>>;
|
||||
|
||||
/// Fetch emoji by their parent ids
|
||||
async fn fetch_emoji_by_parent_ids(&self, parent_ids: &[String]) -> Result<Vec<Emoji>>;
|
||||
|
||||
/// Insert emoji into database.
|
||||
async fn insert_emoji(&self, emoji: &Emoji) -> Result<()>;
|
||||
|
||||
/// Delete an emoji by its id
|
||||
async fn delete_emoji(&self, emoji: &Emoji) -> Result<()>;
|
||||
}
|
||||
Reference in New Issue
Block a user