[fractal/fractal-next] room: Do not preload history of left or outdated rooms



commit c6db0321491e5db955252c2846c455991612854b
Author: Kévin Commaille <zecakeh tedomum fr>
Date:   Tue Feb 15 19:33:26 2022 +0100

    room: Do not preload history of left or outdated rooms

 src/session/room/mod.rs | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/session/room/mod.rs b/src/session/room/mod.rs
index c8d3a7881..baeb4d9ae 100644
--- a/src/session/room/mod.rs
+++ b/src/session/room/mod.rs
@@ -318,13 +318,15 @@ mod imp {
                 .flags(glib::BindingFlags::SYNC_CREATE)
                 .build();
 
-            // Load the room history when idle
-            spawn!(
-                glib::source::PRIORITY_LOW,
-                clone!(@weak obj => async move {
-                    obj.timeline().load().await;
-                })
-            );
+            if !matches!(obj.category(), RoomType::Left | RoomType::Outdated) {
+                // Load the room history when idle
+                spawn!(
+                    glib::source::PRIORITY_LOW,
+                    clone!(@weak obj => async move {
+                        obj.timeline().load().await;
+                    })
+                );
+            }
         }
     }
 }


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