[fractal] cache: Don't store typing_users



commit 47a83f928c873a9b507a146e71ec984fc05730c0
Author: Christopher Davis <brainblasted disroot org>
Date:   Mon Apr 29 19:34:41 2019 -0400

    cache: Don't store typing_users
    
    Previously we cached typing_users when we saved our
    state before closing, which lead to odd behaviour
    when re-opening Fractal where it showed a user as typing
    incorrectly.
    
    Now we reset typing_users as we save the room.
    
    Closes https://gitlab.gnome.org/GNOME/fractal/issues/462

 fractal-gtk/src/cache/state.rs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/fractal-gtk/src/cache/state.rs b/fractal-gtk/src/cache/state.rs
index c76d4034..831b733f 100644
--- a/fractal-gtk/src/cache/state.rs
+++ b/fractal-gtk/src/cache/state.rs
@@ -141,8 +141,11 @@ impl FCache {
 
     pub fn save_room(&self, room: Room) -> Result<(), Error> {
         let cache = self.get_store();
+        let mut stored_room = room.clone();
+        // Don't store typing notifications
+        stored_room.typing_users.clear();
         let approom = AppRoom {
-            room: RefCell::new(room),
+            room: RefCell::new(stored_room),
         };
         approom.store(cache.as_ref().unwrap())?;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]