[fractal/fractal-next] sidebar: Don't count joins/leaves for room sorting



commit df823b910f0553152cbd57a7a91f9632153c633f
Author: Enterprisey <59171-enterprisey users noreply gitlab gnome org>
Date:   Sun Nov 7 13:48:02 2021 -0800

    sidebar: Don't count joins/leaves for room sorting

 src/session/room/mod.rs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/session/room/mod.rs b/src/session/room/mod.rs
index fb0d3b8b..29e833b1 100644
--- a/src/session/room/mod.rs
+++ b/src/session/room/mod.rs
@@ -701,8 +701,12 @@ impl Room {
                 }
                 _ => {}
             }
-            let event_ts = glib::DateTime::from_unix_millis_utc(event.origin_server_ts());
-            latest_change = latest_change.max(event_ts.ok());
+            let event_is_join_or_leave = matches!(&event, 
AnySyncRoomEvent::State(AnySyncStateEvent::RoomMember(event))
+                if event.content.membership == MembershipState::Join || event.content.membership == 
MembershipState::Leave);
+            if !event_is_join_or_leave {
+                let event_ts = glib::DateTime::from_unix_millis_utc(event.origin_server_ts());
+                latest_change = latest_change.max(event_ts.ok());
+            }
         }
 
         priv_.timeline.get().unwrap().append(batch);


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