mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
style: Fix large future clippy errors
This commit is contained in:
@@ -425,7 +425,9 @@ pub async fn full_user_deactivate(
|
||||
// TODO: Redact all messages sent by the user in the room
|
||||
}
|
||||
|
||||
super::update_all_rooms(services, pdu_queue, user_id).await;
|
||||
super::update_all_rooms(services, pdu_queue, user_id)
|
||||
.boxed()
|
||||
.await;
|
||||
for room_id in all_joined_rooms {
|
||||
services.rooms.state_cache.forget(room_id, user_id);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use conduwuit::{
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::{
|
||||
StreamExt, TryStreamExt,
|
||||
FutureExt, StreamExt, TryStreamExt,
|
||||
future::{join, join3, join4},
|
||||
};
|
||||
use ruma::{
|
||||
@@ -51,6 +51,7 @@ pub(crate) async fn set_displayname_route(
|
||||
.await;
|
||||
|
||||
update_displayname(&services, &body.user_id, body.displayname.clone(), &all_joined_rooms)
|
||||
.boxed()
|
||||
.await;
|
||||
|
||||
if services.config.allow_local_presence {
|
||||
@@ -149,6 +150,7 @@ pub(crate) async fn set_avatar_url_route(
|
||||
body.blurhash.clone(),
|
||||
&all_joined_rooms,
|
||||
)
|
||||
.boxed()
|
||||
.await;
|
||||
|
||||
if services.config.allow_local_presence {
|
||||
@@ -344,7 +346,9 @@ pub async fn update_displayname(
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
update_all_rooms(services, all_joined_rooms, user_id).await;
|
||||
update_all_rooms(services, all_joined_rooms, user_id)
|
||||
.boxed()
|
||||
.await;
|
||||
}
|
||||
|
||||
pub async fn update_avatar_url(
|
||||
@@ -394,7 +398,9 @@ pub async fn update_avatar_url(
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
update_all_rooms(services, all_joined_rooms, user_id).await;
|
||||
update_all_rooms(services, all_joined_rooms, user_id)
|
||||
.boxed()
|
||||
.await;
|
||||
}
|
||||
|
||||
pub async fn update_all_rooms(
|
||||
|
||||
@@ -137,6 +137,7 @@ pub(crate) async fn upgrade_room_route(
|
||||
Some(&body.room_id),
|
||||
&state_lock,
|
||||
)
|
||||
.boxed()
|
||||
.await?;
|
||||
// Change lock to replacement room
|
||||
drop(state_lock);
|
||||
|
||||
@@ -60,6 +60,7 @@ pub(crate) async fn send_state_event_for_key_route(
|
||||
None
|
||||
},
|
||||
)
|
||||
.boxed()
|
||||
.await?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::collections::BTreeMap;
|
||||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduwuit::{Err, Result};
|
||||
use futures::StreamExt;
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use ruma::{
|
||||
OwnedRoomId,
|
||||
api::{
|
||||
@@ -112,6 +112,7 @@ pub(crate) async fn set_profile_key_route(
|
||||
Some(display_name.to_owned()),
|
||||
&all_joined_rooms,
|
||||
)
|
||||
.boxed()
|
||||
.await;
|
||||
} else if body.key_name == "avatar_url" {
|
||||
let Some(avatar_url) = profile_key_value.as_str() else {
|
||||
@@ -127,7 +128,9 @@ pub(crate) async fn set_profile_key_route(
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
update_avatar_url(&services, &body.user_id, Some(mxc), None, &all_joined_rooms).await;
|
||||
update_avatar_url(&services, &body.user_id, Some(mxc), None, &all_joined_rooms)
|
||||
.boxed()
|
||||
.await;
|
||||
} else {
|
||||
services.users.set_profile_key(
|
||||
&body.user_id,
|
||||
@@ -178,7 +181,9 @@ pub(crate) async fn delete_profile_key_route(
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
update_displayname(&services, &body.user_id, None, &all_joined_rooms).await;
|
||||
update_displayname(&services, &body.user_id, None, &all_joined_rooms)
|
||||
.boxed()
|
||||
.await;
|
||||
} else if body.key_name == "avatar_url" {
|
||||
let all_joined_rooms: Vec<OwnedRoomId> = services
|
||||
.rooms
|
||||
@@ -188,7 +193,9 @@ pub(crate) async fn delete_profile_key_route(
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
update_avatar_url(&services, &body.user_id, None, None, &all_joined_rooms).await;
|
||||
update_avatar_url(&services, &body.user_id, None, None, &all_joined_rooms)
|
||||
.boxed()
|
||||
.await;
|
||||
} else {
|
||||
services
|
||||
.users
|
||||
|
||||
@@ -2,12 +2,12 @@ use std::borrow::ToOwned;
|
||||
|
||||
use axum::extract::State;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug, debug_info, err, info, matrix::pdu::PduBuilder, utils, warn,
|
||||
Err, Error, Result, debug, debug_info, info, matrix::pdu::PduBuilder, utils, warn,
|
||||
};
|
||||
use conduwuit_service::Services;
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, OwnedUserId, RoomId, RoomVersionId, UserId,
|
||||
OwnedUserId, RoomId, RoomVersionId, UserId,
|
||||
api::{client::error::ErrorKind, federation::membership::prepare_join_event},
|
||||
events::{
|
||||
StateEventType,
|
||||
@@ -302,18 +302,3 @@ pub(crate) async fn user_can_perform_restricted_join(
|
||||
)))
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn maybe_strip_event_id(
|
||||
pdu_json: &mut CanonicalJsonObject,
|
||||
room_version_id: &RoomVersionId,
|
||||
) -> Result {
|
||||
use RoomVersionId::*;
|
||||
|
||||
match room_version_id {
|
||||
| V1 | V2 => Ok(()),
|
||||
| _ => {
|
||||
pdu_json.remove("event_id");
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ use ruma::{
|
||||
};
|
||||
use serde_json::value::to_raw_value;
|
||||
|
||||
use super::make_join::maybe_strip_event_id;
|
||||
use crate::Ruma;
|
||||
|
||||
/// # `GET /_matrix/federation/v1/make_leave/{roomId}/{eventId}`
|
||||
|
||||
Reference in New Issue
Block a user