[fractal] Use lazy_load_members in sync



commit c5c17a492f1807dc63597de926da85bffba0db25
Author: Daniel GarcĂ­a Moreno <dani danigm net>
Date:   Fri Jun 28 10:24:27 2019 +0200

    Use lazy_load_members in sync
    
    Instead of ignore member events we can use the lazy_load_members filter
    flag to retrieve only relevant members.
    
    Fix https://gitlab.gnome.org/GNOME/fractal/issues/432

 fractal-matrix-api/src/backend/sync.rs | 2 +-
 fractal-matrix-api/src/model/filter.rs | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/fractal-matrix-api/src/backend/sync.rs b/fractal-matrix-api/src/backend/sync.rs
index 33e57ab2..ab400bf1 100644
--- a/fractal-matrix-api/src/backend/sync.rs
+++ b/fractal-matrix-api/src/backend/sync.rs
@@ -42,8 +42,8 @@ pub fn sync(bk: &Backend, new_since: Option<String>, initial: bool) -> Result<()
         let filter = Filter {
             room: Some(RoomFilter {
                 state: Some(RoomEventFilter {
+                    lazy_load_members: Some(true),
                     types: Some(vec!["m.room.*"]),
-                    not_types: vec!["m.room.member"],
                     ..Default::default()
                 }),
                 timeline: Some(RoomEventFilter {
diff --git a/fractal-matrix-api/src/model/filter.rs b/fractal-matrix-api/src/model/filter.rs
index 2d852d67..07fb5571 100644
--- a/fractal-matrix-api/src/model/filter.rs
+++ b/fractal-matrix-api/src/model/filter.rs
@@ -62,6 +62,8 @@ pub struct RoomFilter<'a> {
 
 #[derive(Clone, Debug, Default, Serialize)]
 pub struct RoomEventFilter<'a> {
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub lazy_load_members: Option<bool>,
     #[serde(skip_serializing_if = "Option::is_none")]
     pub limit: Option<i32>,
     #[serde(skip_serializing_if = "Vec::is_empty")]


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