diff --git a/src/api/appservice_server.rs b/src/api/appservice_server.rs index 2bc430d9..e4255e5d 100644 --- a/src/api/appservice_server.rs +++ b/src/api/appservice_server.rs @@ -9,12 +9,12 @@ use tracing::warn; /// Sends a request to an appservice /// /// Only returns None if there is no url specified in the appservice registration file -pub(crate) async fn send_request( +pub(crate) async fn send_request( registration: Registration, request: T, ) -> Option> where - T: Debug, + T: OutgoingRequest + Debug, { if let Some(destination) = registration.url { let hs_token = registration.hs_token.as_str(); diff --git a/src/api/server_server.rs b/src/api/server_server.rs index 2562e983..73246574 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -115,12 +115,12 @@ impl FedDest { } } -pub(crate) async fn send_request( +pub(crate) async fn send_request( destination: &ServerName, request: T, ) -> Result where - T: Debug, + T: OutgoingRequest + Debug, { if !services().globals.allow_federation() { return Err(Error::bad_config("Federation is disabled.")); diff --git a/src/service/pusher/mod.rs b/src/service/pusher/mod.rs index d3053ca7..1f700e51 100644 --- a/src/service/pusher/mod.rs +++ b/src/service/pusher/mod.rs @@ -44,13 +44,13 @@ impl Service { } #[tracing::instrument(skip(self, destination, request))] - pub async fn send_request( + pub async fn send_request( &self, destination: &str, request: T, ) -> Result where - T: Debug, + T: OutgoingRequest + Debug, { let destination = destination.replace(services().globals.notification_push_path(), ""); diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index 7f3ba124..53debbcc 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -713,13 +713,13 @@ impl Service { } #[tracing::instrument(skip(self, destination, request))] - pub async fn send_federation_request( + pub async fn send_federation_request( &self, destination: &ServerName, request: T, ) -> Result where - T: Debug, + T: OutgoingRequest + Debug, { if destination.is_ip_literal() || IPAddress::is_valid(destination.host()) { info!( @@ -771,13 +771,13 @@ impl Service { /// Sends a request to an appservice /// /// Only returns None if there is no url specified in the appservice registration file - pub async fn send_appservice_request( + pub async fn send_appservice_request( &self, registration: Registration, request: T, ) -> Option> where - T: Debug, + T: OutgoingRequest + Debug, { let permit = self.maximum_requests.acquire().await; let response = appservice_server::send_request(registration, request).await;