style: Fix large future clippy errors

This commit is contained in:
timedout
2026-04-07 18:31:09 +01:00
committed by Ellis Git
parent 189ed1c394
commit d041adadc8
7 changed files with 27 additions and 26 deletions
+3 -1
View File
@@ -425,7 +425,9 @@ pub async fn full_user_deactivate(
// TODO: Redact all messages sent by the user in the room // 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 { for room_id in all_joined_rooms {
services.rooms.state_cache.forget(room_id, user_id); services.rooms.state_cache.forget(room_id, user_id);
} }
+9 -3
View File
@@ -7,7 +7,7 @@ use conduwuit::{
}; };
use conduwuit_service::Services; use conduwuit_service::Services;
use futures::{ use futures::{
StreamExt, TryStreamExt, FutureExt, StreamExt, TryStreamExt,
future::{join, join3, join4}, future::{join, join3, join4},
}; };
use ruma::{ use ruma::{
@@ -51,6 +51,7 @@ pub(crate) async fn set_displayname_route(
.await; .await;
update_displayname(&services, &body.user_id, body.displayname.clone(), &all_joined_rooms) update_displayname(&services, &body.user_id, body.displayname.clone(), &all_joined_rooms)
.boxed()
.await; .await;
if services.config.allow_local_presence { if services.config.allow_local_presence {
@@ -149,6 +150,7 @@ pub(crate) async fn set_avatar_url_route(
body.blurhash.clone(), body.blurhash.clone(),
&all_joined_rooms, &all_joined_rooms,
) )
.boxed()
.await; .await;
if services.config.allow_local_presence { if services.config.allow_local_presence {
@@ -344,7 +346,9 @@ pub async fn update_displayname(
.collect() .collect()
.await; .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( pub async fn update_avatar_url(
@@ -394,7 +398,9 @@ pub async fn update_avatar_url(
.collect() .collect()
.await; .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( pub async fn update_all_rooms(
+1
View File
@@ -137,6 +137,7 @@ pub(crate) async fn upgrade_room_route(
Some(&body.room_id), Some(&body.room_id),
&state_lock, &state_lock,
) )
.boxed()
.await?; .await?;
// Change lock to replacement room // Change lock to replacement room
drop(state_lock); drop(state_lock);
+1
View File
@@ -60,6 +60,7 @@ pub(crate) async fn send_state_event_for_key_route(
None None
}, },
) )
.boxed()
.await?, .await?,
}) })
} }
+11 -4
View File
@@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use axum::extract::State; use axum::extract::State;
use axum_client_ip::InsecureClientIp; use axum_client_ip::InsecureClientIp;
use conduwuit::{Err, Result}; use conduwuit::{Err, Result};
use futures::StreamExt; use futures::{FutureExt, StreamExt};
use ruma::{ use ruma::{
OwnedRoomId, OwnedRoomId,
api::{ api::{
@@ -112,6 +112,7 @@ pub(crate) async fn set_profile_key_route(
Some(display_name.to_owned()), Some(display_name.to_owned()),
&all_joined_rooms, &all_joined_rooms,
) )
.boxed()
.await; .await;
} else if body.key_name == "avatar_url" { } else if body.key_name == "avatar_url" {
let Some(avatar_url) = profile_key_value.as_str() else { let Some(avatar_url) = profile_key_value.as_str() else {
@@ -127,7 +128,9 @@ pub(crate) async fn set_profile_key_route(
.collect() .collect()
.await; .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 { } else {
services.users.set_profile_key( services.users.set_profile_key(
&body.user_id, &body.user_id,
@@ -178,7 +181,9 @@ pub(crate) async fn delete_profile_key_route(
.collect() .collect()
.await; .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" { } else if body.key_name == "avatar_url" {
let all_joined_rooms: Vec<OwnedRoomId> = services let all_joined_rooms: Vec<OwnedRoomId> = services
.rooms .rooms
@@ -188,7 +193,9 @@ pub(crate) async fn delete_profile_key_route(
.collect() .collect()
.await; .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 { } else {
services services
.users .users
+2 -17
View File
@@ -2,12 +2,12 @@ use std::borrow::ToOwned;
use axum::extract::State; use axum::extract::State;
use conduwuit::{ 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 conduwuit_service::Services;
use futures::StreamExt; use futures::StreamExt;
use ruma::{ use ruma::{
CanonicalJsonObject, OwnedUserId, RoomId, RoomVersionId, UserId, OwnedUserId, RoomId, RoomVersionId, UserId,
api::{client::error::ErrorKind, federation::membership::prepare_join_event}, api::{client::error::ErrorKind, federation::membership::prepare_join_event},
events::{ events::{
StateEventType, 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(())
},
}
}
-1
View File
@@ -6,7 +6,6 @@ use ruma::{
}; };
use serde_json::value::to_raw_value; use serde_json::value::to_raw_value;
use super::make_join::maybe_strip_event_id;
use crate::Ruma; use crate::Ruma;
/// # `GET /_matrix/federation/v1/make_leave/{roomId}/{eventId}` /// # `GET /_matrix/federation/v1/make_leave/{roomId}/{eventId}`