From 4d3f5abc20a44efc5c9b53efe3b21d34304dc46a Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Sun, 6 Oct 2024 17:28:01 -0600 Subject: Allow just prefix to set ap latch without proxying --- src/system/message_parser.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/system/message_parser.rs') diff --git a/src/system/message_parser.rs b/src/system/message_parser.rs index b044f61..e769eed 100644 --- a/src/system/message_parser.rs +++ b/src/system/message_parser.rs @@ -9,6 +9,7 @@ use super::{FullMessage, MemberId, MessageId, Timestamp, UserId}; pub enum ParsedMessage { Command(Command), + SetProxyAndDelete(MemberId), ProxiedMessage { member_id: MemberId, message_content: String, @@ -155,11 +156,15 @@ impl MessageParser { ); if let Some((member_id, matched_content)) = matches_prefix { - Some(ParsedMessage::ProxiedMessage { - member_id, - message_content: matched_content.to_string(), - latch: true, - }) + if matched_content.trim() != "" { + Some(ParsedMessage::ProxiedMessage { + member_id, + message_content: matched_content.to_string(), + latch: true, + }) + } else { + Some(ParsedMessage::SetProxyAndDelete(member_id)) + } } else { None } -- cgit 1.4.1