summary refs log tree commit diff
path: root/src/system/message_parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/system/message_parser.rs')
-rw-r--r--src/system/message_parser.rs15
1 files changed, 10 insertions, 5 deletions
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
         }