From f5e3b0e2dd1c47d6d7dc3a9c21da892472ab57de Mon Sep 17 00:00:00 2001 From: Jonathan Flueren <9669250-JonOfUs@users.noreply.gitlab.com> Date: Mon, 15 May 2023 19:25:57 +0000 Subject: [PATCH] Recognize admin commands without : after tag Very useful since many Matrix clients don't insert : after user tags --- src/service/rooms/timeline/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index 47f4c65c..249b2a2d 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -443,7 +443,8 @@ impl Service { )?; let server_user = format!("@conduit:{}", services().globals.server_name()); - let to_conduit = body.starts_with(&format!("{server_user}: ")); + let to_conduit = body.starts_with(&format!("{server_user}: ")) + || body.starts_with(&format!("{server_user} ")); // This will evaluate to false if the emergency password is set up so that // the administrator can execute commands as conduit