forked from jmug/stoatchat
feat: include groups and dms in fetch mutuals
This commit is contained in:
@@ -255,12 +255,14 @@ auto_derived!(
|
||||
pub flags: i32,
|
||||
}
|
||||
|
||||
/// Mutual friends and servers response
|
||||
/// Mutual friends, servers, groups and DMs response
|
||||
pub struct MutualResponse {
|
||||
/// Array of mutual user IDs that both users are friends with
|
||||
pub users: Vec<String>,
|
||||
/// Array of mutual server IDs that both users are in
|
||||
pub servers: Vec<String>,
|
||||
/// Array of mutual group and dm IDs that both users are in
|
||||
pub channels: Vec<String>,
|
||||
}
|
||||
|
||||
/// Bot information for if the user is a bot
|
||||
|
||||
@@ -8,9 +8,9 @@ use revolt_result::{create_error, Result};
|
||||
use rocket::serde::json::Json;
|
||||
use rocket::State;
|
||||
|
||||
/// # Fetch Mutual Friends And Servers
|
||||
/// # Fetch Mutual Friends, Servers, Groups and DMs
|
||||
///
|
||||
/// Retrieve a list of mutual friends and servers with another user.
|
||||
/// Retrieve a list of mutual friends, servers, groups and DMs with another user.
|
||||
#[openapi(tag = "Relationships")]
|
||||
#[get("/<target>/mutual")]
|
||||
pub async fn mutual(
|
||||
@@ -32,5 +32,6 @@ pub async fn mutual(
|
||||
Ok(Json(v0::MutualResponse {
|
||||
users: db.fetch_mutual_user_ids(&user.id, &target.id).await?,
|
||||
servers: db.fetch_mutual_server_ids(&user.id, &target.id).await?,
|
||||
channels: db.fetch_mutual_channel_ids(&user.id, &target.id).await?,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user