fix: Don't process admin escape commands for local users from federation

Reviewed-By: timedout <git@nexy7574.co.uk>
This commit is contained in:
Jade Ellis
2026-02-11 14:37:20 +00:00
committed by timedout
parent 37888fb670
commit 754959e80d
3 changed files with 58 additions and 11 deletions
+15 -1
View File
@@ -530,7 +530,12 @@ impl Service {
Ok(())
}
pub async fn is_admin_command<E>(&self, event: &E, body: &str) -> Option<InvocationSource>
pub async fn is_admin_command<E>(
&self,
event: &E,
body: &str,
sent_locally: bool,
) -> Option<InvocationSource>
where
E: Event + Send + Sync,
{
@@ -580,6 +585,15 @@ impl Service {
return None;
}
// Escaped commands must be sent locally (via client API), not via federation
if !sent_locally {
conduwuit::warn!(
"Ignoring escaped admin command from {} that arrived via federation",
event.sender()
);
return None;
}
// Looks good
Some(InvocationSource::EscapedCommand)
}