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 authored and timedout committed 2026-03-03 19:55:50 +00:00
1 parent 37888fb670
commit 754959e80d
3 files changed
+58 -11

No files matched your search

+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)
}