[fractal] room: download full list of members for each room



commit 9cdf4760cd4468ca2712558b8b566764108276fc
Author: Julian Sparber <julian sparber net>
Date:   Thu Jan 24 15:23:13 2019 +0100

    room: download full list of members for each room

 fractal-gtk/src/appop/room.rs          | 11 +++++------
 fractal-matrix-api/src/backend/room.rs |  3 ++-
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/fractal-gtk/src/appop/room.rs b/fractal-gtk/src/appop/room.rs
index 3c68444c..42a94ade 100644
--- a/fractal-gtk/src/appop/room.rs
+++ b/fractal-gtk/src/appop/room.rs
@@ -56,13 +56,12 @@ impl AppOp {
             } else if self.rooms.contains_key(&room.id) {
                 // TODO: update the existing rooms
             } else {
-                if room.name.is_none() {
-                    // This force the room name calculation for 1:1 rooms and for rooms with no name
-                    self.backend
-                        .send(BKCommand::GetRoomMembers(room.id.clone()))
-                        .unwrap();
-                }
+                // Request all joined members for each new room
+                self.backend
+                    .send(BKCommand::GetRoomMembers(room.id.clone()))
+                    .unwrap();
                 // Download the room avatar
+                // TODO: Use the avatar url returned by sync
                 self.backend
                     .send(BKCommand::GetRoomAvatar(room.id.clone()))
                     .unwrap();
diff --git a/fractal-matrix-api/src/backend/room.rs b/fractal-matrix-api/src/backend/room.rs
index a1b9bef6..69ced0fb 100644
--- a/fractal-matrix-api/src/backend/room.rs
+++ b/fractal-matrix-api/src/backend/room.rs
@@ -29,11 +29,12 @@ use crate::types::{Room, RoomMembership, RoomTag};
 
 use serde_json::Value as JsonValue;
 
+// FIXME: Remove this function, this is used only to request information we should already have
+// when opening a room
 pub fn set_room(bk: &Backend, id: String) -> Result<(), Error> {
     /* FIXME: remove clone and pass id by reference */
     get_room_avatar(bk, id.clone())?;
     get_room_detail(bk, id.clone(), String::from("m.room.topic"))?;
-    get_room_members(bk, id)?;
 
     Ok(())
 }


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