feat: Message pinning

This commit is contained in:
Zomatree
2024-07-18 18:37:41 +01:00
parent 412f4a99d7
commit 389ecc0e5c
13 changed files with 136 additions and 2 deletions

View File

@@ -30,6 +30,10 @@ pub async fn search(
})
})?;
if options.query.is_some() && options.pinned.is_some() {
return Err(create_error!(InvalidOperation))
}
let channel = target.as_channel(db).await?;
let mut query = DatabasePermissionQuery::new(db, &user).channel(&channel);
@@ -39,6 +43,7 @@ pub async fn search(
let v0::DataMessageSearch {
query,
pinned,
limit,
before,
after,
@@ -51,7 +56,8 @@ pub async fn search(
MessageQuery {
filter: MessageFilter {
channel: Some(channel.id().to_string()),
query: Some(query),
query,
pinned,
..Default::default()
},
time_period: MessageTimePeriod::Absolute {