diff --git a/src/service/sending/antispam.rs b/src/service/sending/antispam.rs index 7aa1b248f..580e9a067 100644 --- a/src/service/sending/antispam.rs +++ b/src/service/sending/antispam.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, fmt::Debug, mem, time::Instant}; use bytes::BytesMut; -use conduwuit::{Err, Result, debug_info, err, utils, utils::response::LimitReadExt, warn}; +use conduwuit::{Err, Result, debug_info, err, utils::response::LimitReadExt}; use reqwest::Client; use ruma::api::{ IncomingResponse, OutgoingRequest, diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index b43098af3..01a568d6a 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -53,7 +53,6 @@ pub struct Service { struct Services { client: Dep, globals: Dep, - state: Dep, state_cache: Dep, user: Dep, users: Dep, @@ -97,7 +96,6 @@ fn build(args: crate::Args<'_>) -> Result> { services: Services { client: args.depend::("client"), globals: args.depend::("globals"), - state: args.depend::("rooms::state"), state_cache: args.depend::("rooms::state_cache"), user: args.depend::("rooms::user"), users: args.depend::("users"), diff --git a/src/service/sending/sender.rs b/src/service/sending/sender.rs index 0c44d66d9..c07139841 100644 --- a/src/service/sending/sender.rs +++ b/src/service/sending/sender.rs @@ -1,7 +1,6 @@ use std::{ collections::{BTreeMap, HashMap, HashSet}, fmt::Debug, - future::ready, sync::{ Arc, atomic::{AtomicU64, AtomicUsize, Ordering}, @@ -11,13 +10,11 @@ use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD}; use conduwuit::{ - debug_error, debug_info, debug_warn, info, - utils::time::exponential_backoff::min_exp_backoff_duration, + debug_info, debug_warn, info, utils::time::exponential_backoff::min_exp_backoff_duration, }; use conduwuit_core::{ Error, Event, Result, at, debug, err, error, result::LogErr, - trace, utils::{ ReadyExt, calculate_hash, continue_exponential_backoff_secs, future::TryExtExt, @@ -33,7 +30,7 @@ }; use ruma::{ CanonicalJsonObject, MilliSecondsSinceUnixEpoch, OwnedRoomId, OwnedServerName, OwnedUserId, - RoomId, RoomVersionId, ServerName, UInt, + RoomId, ServerName, UInt, api::{ appservice::event::push_events::v1::EphemeralData, federation::transactions::{ @@ -164,10 +161,11 @@ fn handle_response_err(dest: Destination, statuses: &mut CurTransactionStatus, e } /// Handles a successful response, queueing up more sends if necessary. + #[allow(clippy::needless_pass_by_ref_mut)] async fn handle_response_ok<'a>( &'a self, dest: &Destination, - futures: &SendingFutures<'a>, + futures: &mut SendingFutures<'a>, statuses: &mut CurTransactionStatus, ) { let _cork = self.db.db.cork(); @@ -196,10 +194,11 @@ async fn handle_response_ok<'a>( /// no new events to send the destination, it is removed from the status map /// instead. #[tracing::instrument(name = "request", level = "debug", skip_all)] + #[allow(clippy::needless_pass_by_ref_mut)] async fn handle_request<'a>( &'a self, msg: Msg, - futures: &SendingFutures<'a>, + futures: &mut SendingFutures<'a>, statuses: &mut CurTransactionStatus, ) { let iv = vec![(msg.queue_id, msg.event)];