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
|
// 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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ pub(crate) async fn send_state_event_for_key_route(
|
|||||||
None
|
None
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
.boxed()
|
||||||
.await?,
|
.await?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,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(())
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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}`
|
||||||
|
|||||||
Reference in New Issue
Block a user