feat: include groups and dms in fetch mutuals
This commit is contained in:
@@ -255,12 +255,14 @@ auto_derived!(
|
|||||||
pub flags: i32,
|
pub flags: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Mutual friends and servers response
|
/// Mutual friends, servers, groups and DMs response
|
||||||
pub struct MutualResponse {
|
pub struct MutualResponse {
|
||||||
/// Array of mutual user IDs that both users are friends with
|
/// Array of mutual user IDs that both users are friends with
|
||||||
pub users: Vec<String>,
|
pub users: Vec<String>,
|
||||||
/// Array of mutual server IDs that both users are in
|
/// Array of mutual server IDs that both users are in
|
||||||
pub servers: Vec<String>,
|
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
|
/// 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::serde::json::Json;
|
||||||
use rocket::State;
|
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")]
|
#[openapi(tag = "Relationships")]
|
||||||
#[get("/<target>/mutual")]
|
#[get("/<target>/mutual")]
|
||||||
pub async fn mutual(
|
pub async fn mutual(
|
||||||
@@ -32,5 +32,6 @@ pub async fn mutual(
|
|||||||
Ok(Json(v0::MutualResponse {
|
Ok(Json(v0::MutualResponse {
|
||||||
users: db.fetch_mutual_user_ids(&user.id, &target.id).await?,
|
users: db.fetch_mutual_user_ids(&user.id, &target.id).await?,
|
||||||
servers: db.fetch_mutual_server_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