From 8c8ede431c9d5beb557597acb83529e982460f08 Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Mon, 2 Aug 2021 21:19:50 +0200 Subject: [PATCH] Bug fix: set not seen before notifying UI --- src/session_manager.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/session_manager.rs b/src/session_manager.rs index 437f6c6..f0b5180 100644 --- a/src/session_manager.rs +++ b/src/session_manager.rs @@ -438,6 +438,7 @@ impl SessionManager { timestamp, data: buffer, }; + self.set_seen(session_id, false); self.with_ui_connection(|ui_connection| { ui_connection.on_new_msg(&session_id, &msg); }); @@ -447,6 +448,7 @@ impl SessionManager { if let Some((filename, content)) = protocol::parse_file(&buffer) { match self.store_file(&session_id, content) { Ok(file_uuid) => { + self.set_seen(session_id, false); self.with_ui_connection(|ui_connection| { ui_connection.on_new_file(&session_id, false, timestamp, filename, file_uuid); }); @@ -469,9 +471,6 @@ impl SessionManager { } _ => {} } - if header == protocol::Headers::MESSAGE || header == protocol::Headers::FILE { - self.set_seen(session_id, false); - } } } }