Bug fix: set not seen before notifying UI

This commit is contained in:
Matéo Duparc 2021-08-02 21:19:50 +02:00
parent c4417cf802
commit 8c8ede431c
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E

View File

@ -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);
}
}
}
}