chore: Remove redundant client IP extractions on individual routes

This commit is contained in:
timedout authored and Ellis Git committed 2026-07-17 12:57:48 +00:00
1 parent 1e47090f5d
commit 789589ef37
26 files changed
+71 -205

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ use crate::{Ruma, RumaResponse, client_ip::ClientIp};
/// Sends a state event into the room.
pub(crate) async fn send_state_event_for_key_route(
State(services): State<crate::State>,
ClientIp(ip): ClientIp,
ClientIp(ip): ClientIp, // NOTE: Required for updating device metadata
body: Ruma<send_state_event::v3::Request>,
) -> Result<send_state_event::v3::Response> {
let sender_user = body.identity.expect_sender_user()?;
@@ -71,7 +71,7 @@ pub(crate) async fn send_state_event_for_key_route(
/// Sends a state event into the room.
pub(crate) async fn send_state_event_for_empty_key_route(
State(services): State<crate::State>,
ClientIp(ip): ClientIp,
ClientIp(ip): ClientIp, // NOTE: Required for updating device metadata
body: Ruma<send_state_event::v3::Request>,
) -> Result<RumaResponse<send_state_event::v3::Response>> {
send_state_event_for_key_route(State(services), ClientIp(ip), body)