diff options
Diffstat (limited to 'src/system/plugin/autoproxy.rs')
-rw-r--r-- | src/system/plugin/autoproxy.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/system/plugin/autoproxy.rs b/src/system/plugin/autoproxy.rs index bba25a5..67d93a0 100644 --- a/src/system/plugin/autoproxy.rs +++ b/src/system/plugin/autoproxy.rs @@ -53,13 +53,22 @@ impl SeancePlugin for Autoproxy { } async fn handle_message(&self, logger: &Logger, system: &System, message: &Message, response: &mut Response) { + let starting_state = {self.current_state.lock().await.clone()}; if message.content.starts_with("\\") { + logger.log_line(None, "Skipping proxy".to_string()).await; + if message.content.starts_with("\\\\") { - if let InnerState::LatchActive {current_member: _, last_message: _} = {self.current_state.lock().await.clone()} { + if let InnerState::LatchActive {current_member: _, last_message: _} = starting_state { + logger.log_line(None, "Unlatching".to_string()).await; {*self.current_state.lock().await = InnerState::LatchInactive}; + logger.log_line(None, "Done".to_string()).await; } } + if message.content == "\\\\" { + logger.log_line(None, "Deleting source message".to_string()).await; + } + *response = Response::Noop { delete_source: message.content == "\\\\" }; return } |