mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
chore: Clippy fixes
This commit is contained in:
@@ -20,11 +20,8 @@ use ruma::{
|
||||
OwnedEventId, OwnedMxcUri, OwnedRoomId, OwnedUserId, RoomId, UInt, UserId,
|
||||
events::{
|
||||
Mentions,
|
||||
room::{
|
||||
MediaSource,
|
||||
message::{
|
||||
FileInfo, FileMessageEventContent, MessageType, Relation, RoomMessageEventContent,
|
||||
},
|
||||
room::message::{
|
||||
FileInfo, FileMessageEventContent, MessageType, Relation, RoomMessageEventContent,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
use std::{any::Any, borrow::Cow, fmt::Debug, mem, sync::LazyLock};
|
||||
use std::{borrow::Cow, fmt::Debug, mem};
|
||||
|
||||
use bytes::Bytes;
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug, debug_error, debug_warn, err, implement,
|
||||
matrix::versions::{unstable_features, versions},
|
||||
trace,
|
||||
Err, Error, Result, debug, debug_error, debug_warn, err, implement, trace,
|
||||
utils::response::LimitReadExt,
|
||||
};
|
||||
use ipaddress::IPAddress;
|
||||
use reqwest::{Client, Method, Request, Response, Url};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, ServerName, ServerSigningKeyId,
|
||||
ServerName,
|
||||
api::{
|
||||
EndpointError, IncomingResponse, Metadata, OutgoingRequest, SupportedVersions,
|
||||
auth_scheme::{AuthScheme, NoAuthentication, SendAccessToken},
|
||||
EndpointError, IncomingResponse, OutgoingRequest, SupportedVersions,
|
||||
auth_scheme::{AuthScheme, NoAuthentication},
|
||||
error::Error as RumaError,
|
||||
federation::authentication::{ServerSignatures, ServerSignaturesInput, XMatrix},
|
||||
path_builder::{PathBuilder, SinglePath, VersionHistory},
|
||||
federation::authentication::{ServerSignatures, ServerSignaturesInput},
|
||||
path_builder::PathBuilder,
|
||||
},
|
||||
serde::Base64,
|
||||
};
|
||||
|
||||
use crate::{SUPPORTED_VERSIONS, resolver::actual::ActualDest};
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
use std::time::SystemTime;
|
||||
|
||||
use conduwuit::{Err, Result, debug, err, utils::response::LimitReadExt};
|
||||
#[cfg(feature = "url_preview")]
|
||||
use conduwuit::utils::response::LimitReadExt;
|
||||
use conduwuit::{Err, Result, debug, err};
|
||||
use conduwuit_core::implement;
|
||||
use ipaddress::IPAddress;
|
||||
#[cfg(feature = "url_preview")]
|
||||
|
||||
@@ -8,8 +8,8 @@ use http::header::{CONTENT_DISPOSITION, CONTENT_TYPE, HeaderValue};
|
||||
use ruma::{
|
||||
ServerName, UserId,
|
||||
api::{
|
||||
Metadata, OutgoingRequest,
|
||||
auth_scheme::{NoAccessToken, NoAuthentication},
|
||||
OutgoingRequest,
|
||||
auth_scheme::NoAccessToken,
|
||||
client::media,
|
||||
error::ErrorKind::{NotFound, Unrecognized},
|
||||
federation::{
|
||||
|
||||
@@ -14,7 +14,7 @@ use database::Json;
|
||||
use futures::{FutureExt, StreamExt, TryStreamExt};
|
||||
use itertools::Itertools;
|
||||
use ruma::{
|
||||
OwnedRoomId, OwnedUserId, RoomId, UserId,
|
||||
OwnedRoomId, OwnedUserId, UserId,
|
||||
events::{
|
||||
AnyStrippedStateEvent, GlobalAccountDataEventType, StateEventType,
|
||||
push_rules::PushRulesEvent,
|
||||
|
||||
@@ -14,7 +14,7 @@ use ruma::{
|
||||
DeviceId, OwnedDeviceId, RoomId, UInt, UserId,
|
||||
api::{
|
||||
IncomingResponse, MatrixVersion, OutgoingRequest,
|
||||
auth_scheme::{NoAccessToken, NoAuthentication, SendAccessToken},
|
||||
auth_scheme::NoAuthentication,
|
||||
client::push::{Pusher, PusherKind, set_pusher},
|
||||
path_builder::SinglePath,
|
||||
push_gateway::send_event_notification::{
|
||||
@@ -22,18 +22,11 @@ use ruma::{
|
||||
v1::{Device, Notification, NotificationCounts, NotificationPriority},
|
||||
},
|
||||
},
|
||||
events::{
|
||||
AnySyncTimelineEvent, StateEventType, TimelineEventType,
|
||||
room::{
|
||||
create::RoomCreateEventContent,
|
||||
power_levels::{RoomPowerLevels, RoomPowerLevelsEventContent},
|
||||
},
|
||||
},
|
||||
events::{AnySyncTimelineEvent, TimelineEventType, room::power_levels::RoomPowerLevels},
|
||||
push::{
|
||||
Action, HighlightTweakValue, PushConditionPowerLevelsCtx, PushConditionRoomCtx,
|
||||
PushFormat, Ruleset, Tweak,
|
||||
},
|
||||
room_version_rules::{AuthorizationRules, RoomPowerLevelsRules, RoomVersionRules},
|
||||
serde::Raw,
|
||||
uint,
|
||||
};
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use conduwuit::{
|
||||
Result, debug, debug_error, debug_info, implement, trace, utils::response::LimitReadExt,
|
||||
};
|
||||
use ruma::{OwnedServerName, ServerName};
|
||||
use ruma::ServerName;
|
||||
|
||||
#[implement(super::Service)]
|
||||
#[tracing::instrument(name = "well-known", level = "debug", skip(self, dest))]
|
||||
|
||||
@@ -3,18 +3,14 @@ mod remote;
|
||||
use std::sync::Arc;
|
||||
|
||||
use conduwuit::{
|
||||
Err, Event, Result, err,
|
||||
Err, Result, err,
|
||||
utils::{ReadyExt, stream::TryIgnore},
|
||||
};
|
||||
use database::{Deserialized, Ignore, Interfix, Map};
|
||||
use futures::{Stream, StreamExt, TryFutureExt};
|
||||
use ruma::{
|
||||
OwnedRoomAliasId, OwnedRoomId, OwnedServerName, OwnedUserId, RoomAliasId, RoomId,
|
||||
RoomOrAliasId, UserId,
|
||||
events::{
|
||||
StateEventType,
|
||||
room::power_levels::{RoomPowerLevels, RoomPowerLevelsEventContent},
|
||||
},
|
||||
RoomOrAliasId, UserId, events::StateEventType,
|
||||
};
|
||||
|
||||
use crate::{Dep, admin, appservice, appservice::RegistrationInfo, globals, rooms, sending};
|
||||
|
||||
@@ -11,7 +11,7 @@ use conduwuit::{
|
||||
utils::stream::{IterStream, ReadyExt, TryWidebandExt, WidebandExt},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};
|
||||
use ruma::{OwnedEventId, RoomId, RoomVersionId, room_version_rules::RoomVersionRules};
|
||||
use ruma::{OwnedEventId, RoomId, room_version_rules::RoomVersionRules};
|
||||
|
||||
use crate::rooms::state_compressor::CompressedState;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ use conduwuit::{
|
||||
utils::stream::{BroadbandExt, IterStream, ReadyExt, TryBroadbandExt, TryWidebandExt},
|
||||
};
|
||||
use futures::{FutureExt, StreamExt, TryFutureExt, TryStreamExt, future::try_join};
|
||||
use ruma::{OwnedEventId, RoomId, RoomVersionId, room_version_rules::RoomVersionRules};
|
||||
use ruma::{OwnedEventId, RoomId, room_version_rules::RoomVersionRules};
|
||||
|
||||
use crate::rooms::short::ShortStateHash;
|
||||
|
||||
|
||||
@@ -15,14 +15,13 @@ use ruma::{
|
||||
room::{
|
||||
avatar::RoomAvatarEventContent,
|
||||
canonical_alias::RoomCanonicalAliasEventContent,
|
||||
create::{RoomCreateEvent, RoomCreateEventContent},
|
||||
create::RoomCreateEventContent,
|
||||
encryption::RoomEncryptionEventContent,
|
||||
guest_access::{GuestAccess, RoomGuestAccessEventContent},
|
||||
history_visibility::{HistoryVisibility, RoomHistoryVisibilityEventContent},
|
||||
join_rules::{JoinRule, RoomJoinRulesEventContent},
|
||||
member::RoomMemberEventContent,
|
||||
name::RoomNameEventContent,
|
||||
pinned_events::RoomPinnedEventsEventContent,
|
||||
power_levels::{RoomPowerLevels, RoomPowerLevelsEventContent},
|
||||
topic::RoomTopicEventContent,
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@ use database::Ignore;
|
||||
use futures::{Stream, StreamExt, stream::iter};
|
||||
use itertools::Itertools;
|
||||
use ruma::{
|
||||
OwnedServerName, RoomId, ServerName,
|
||||
OwnedServerName, RoomId,
|
||||
events::{StateEventType, room::power_levels::RoomPowerLevelsEventContent},
|
||||
int,
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::{collections::HashSet, iter::once};
|
||||
use std::collections::HashSet;
|
||||
|
||||
use conduwuit::{Err, PduEvent};
|
||||
use conduwuit_core::{
|
||||
@@ -7,21 +7,12 @@ use conduwuit_core::{
|
||||
event::Event,
|
||||
pdu::{PduCount, PduId, RawPduId},
|
||||
},
|
||||
utils::{IterStream, ReadyExt},
|
||||
validated, warn,
|
||||
};
|
||||
use futures::{FutureExt, Stream, StreamExt};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, EventId, Int, OwnedServerName, RoomId, ServerName,
|
||||
api::federation,
|
||||
events::{
|
||||
StateEventType, TimelineEventType,
|
||||
room::{
|
||||
create::RoomCreateEventContent,
|
||||
power_levels::{RoomPowerLevelsEventContent, UserPowerLevel},
|
||||
},
|
||||
},
|
||||
uint,
|
||||
CanonicalJsonObject, EventId, OwnedServerName, RoomId, ServerName, api::federation,
|
||||
events::TimelineEventType, uint,
|
||||
};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
@@ -58,7 +49,7 @@ pub async fn backfill_if_required(&self, room_id: &RoomId, from: PduCount) -> Re
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut servers = self.candidate_backfill_servers(room_id).await;
|
||||
let servers = self.candidate_backfill_servers(room_id).await;
|
||||
|
||||
let mut federated_room = false;
|
||||
|
||||
@@ -128,7 +119,7 @@ pub async fn get_remote_pdu(&self, room_id: &RoomId, event_id: &EventId) -> Resu
|
||||
return Err!(Request(NotFound("No one can backfill this PDU, room is empty.")));
|
||||
}
|
||||
|
||||
let mut servers = self.candidate_backfill_servers(room_id).await;
|
||||
let servers = self.candidate_backfill_servers(room_id).await;
|
||||
|
||||
for backfill_server in servers {
|
||||
info!("Asking {backfill_server} for event {}", event_id);
|
||||
|
||||
@@ -13,12 +13,11 @@ use conduwuit_core::{
|
||||
};
|
||||
use futures::{StreamExt, TryStreamExt, future, future::ready};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, OwnedRoomId, RoomId, RoomVersionId,
|
||||
UserId,
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, RoomId, UserId,
|
||||
events::{StateEventType, TimelineEventType, room::create::RoomCreateEventContent},
|
||||
uint,
|
||||
};
|
||||
use serde_json::value::{RawValue, to_raw_value};
|
||||
use serde_json::value::to_raw_value;
|
||||
|
||||
use super::RoomMutexGuard;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use conduwuit::{
|
||||
Err, Result, debug_error, err, implement, trace, utils, utils::response::LimitReadExt, warn,
|
||||
};
|
||||
use ruma::api::{
|
||||
IncomingResponse, MatrixVersion, OutgoingRequest,
|
||||
IncomingResponse, OutgoingRequest,
|
||||
appservice::Registration,
|
||||
auth_scheme::{AccessToken, SendAccessToken},
|
||||
path_builder::SinglePath,
|
||||
|
||||
@@ -6,7 +6,7 @@ use conduwuit::{
|
||||
};
|
||||
use database::{Database, Deserialized, Map};
|
||||
use futures::{Stream, StreamExt};
|
||||
use ruma::{OwnedServerName, ServerName, UserId};
|
||||
use ruma::{ServerName, UserId};
|
||||
|
||||
use super::{Destination, SendingEvent};
|
||||
use crate::{Dep, globals};
|
||||
|
||||
@@ -2,8 +2,8 @@ use std::borrow::Borrow;
|
||||
|
||||
use conduwuit::{Err, Result, debug_error, implement, trace};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, RoomVersionId, ServerName, ServerSigningKeyId,
|
||||
api::federation::discovery::VerifyKey, room_version_rules::RoomVersionRules,
|
||||
CanonicalJsonObject, ServerName, ServerSigningKeyId, api::federation::discovery::VerifyKey,
|
||||
room_version_rules::RoomVersionRules,
|
||||
};
|
||||
|
||||
use super::{PubKeyMap, PubKeys, extract_key};
|
||||
|
||||
@@ -15,8 +15,8 @@ use conduwuit::{
|
||||
use database::{Deserialized, Json, Map};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
CanonicalJsonObject, MilliSecondsSinceUnixEpoch, OwnedServerSigningKeyId, RoomVersionId,
|
||||
ServerName, ServerSigningKeyId,
|
||||
CanonicalJsonObject, MilliSecondsSinceUnixEpoch, OwnedServerSigningKeyId, ServerName,
|
||||
ServerSigningKeyId,
|
||||
api::federation::discovery::{ServerSigningKeys, VerifyKey},
|
||||
room_version_rules::RoomVersionRules,
|
||||
serde::Raw,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use conduwuit::{Result, implement};
|
||||
use ruma::{CanonicalJsonObject, RoomVersionId, room_version_rules::RoomVersionRules};
|
||||
use ruma::{CanonicalJsonObject, room_version_rules::RoomVersionRules};
|
||||
|
||||
#[implement(super::Service)]
|
||||
pub fn sign_json(&self, object: &mut CanonicalJsonObject) -> Result {
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, IdParseError, OwnedEventId, OwnedServerName,
|
||||
OwnedServerSigningKeyId, RoomVersionId, UserId,
|
||||
canonical_json::JsonType,
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedServerName, OwnedServerSigningKeyId,
|
||||
room_version_rules::SignaturesRules,
|
||||
signatures::{JsonError, VerificationError, required_server_signatures_to_verify_event},
|
||||
signatures::{VerificationError, required_server_signatures_to_verify_event},
|
||||
};
|
||||
|
||||
/// Extracts the server names and key ids to check signatures for given event.
|
||||
pub fn required_keys(
|
||||
pub(super) fn required_keys(
|
||||
object: &CanonicalJsonObject,
|
||||
rules: &SignaturesRules,
|
||||
) -> Result<BTreeMap<OwnedServerName, Vec<OwnedServerSigningKeyId>>, VerificationError> {
|
||||
|
||||
@@ -2,8 +2,8 @@ use conduwuit::{
|
||||
Err, Result, debug_warn, implement, matrix::event::gen_event_id_canonical_json, trace,
|
||||
};
|
||||
use ruma::{
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, RoomVersionId,
|
||||
room_version_rules::RoomVersionRules, signatures::Verified,
|
||||
CanonicalJsonObject, CanonicalJsonValue, OwnedEventId, room_version_rules::RoomVersionRules,
|
||||
signatures::Verified,
|
||||
};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user