This commit is contained in:
parent
d1a68c635c
commit
a4bb3cfcca
7 changed files with 556 additions and 364 deletions
|
|
@ -26,6 +26,7 @@ pub fn routes() -> Router<AppState> {
|
|||
"/dms/{other_user_id}/messages",
|
||||
get(list_dm_messages).post(send_dm_message),
|
||||
)
|
||||
.route("/presence", get(presence_list))
|
||||
.route("/rtc-config", get(rtc_config))
|
||||
.route("/guilds", get(list_guilds).post(create_guild))
|
||||
.route("/guilds/{guild_id}/members", get(list_guild_members))
|
||||
|
|
@ -293,6 +294,14 @@ async fn me(State(state): State<AppState>, user: AuthUser) -> Result<impl IntoRe
|
|||
Ok(Json(me))
|
||||
}
|
||||
|
||||
async fn presence_list(
|
||||
State(state): State<AppState>,
|
||||
_user: AuthUser,
|
||||
) -> Result<impl IntoResponse, ApiError> {
|
||||
let users = state.chat.get_online_users().await;
|
||||
Ok(Json(users))
|
||||
}
|
||||
|
||||
async fn list_dm_conversations(
|
||||
State(state): State<AppState>,
|
||||
user: AuthUser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue