summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--resources/qml/RoomList.qml2
-rw-r--r--src/timeline/RoomlistModel.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 89af78a5..979e727d 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -46,7 +46,7 @@ Page {
             states: [
                 State {
                     name: "highlight"
-                    when: hovered.hovered
+                    when: hovered.hovered && !(TimelineManager.timeline && model.roomId == TimelineManager.timeline.roomId())
 
                     PropertyChanges {
                         target: roomItem
diff --git a/src/timeline/RoomlistModel.cpp b/src/timeline/RoomlistModel.cpp
index 6d741322..28c3cf46 100644
--- a/src/timeline/RoomlistModel.cpp
+++ b/src/timeline/RoomlistModel.cpp
@@ -227,6 +227,17 @@ RoomlistModel::sync(const mtx::responses::Rooms &rooms)
                         }
                 }
         }
+
+        for (const auto &[room_id, room] : rooms.leave) {
+                (void)room;
+                auto idx = this->roomidToIndex(QString::fromStdString(room_id));
+                if (idx != -1) {
+                        beginRemoveRows(QModelIndex(), idx, idx);
+                        roomids.erase(roomids.begin() + idx);
+                        models.remove(QString::fromStdString(room_id));
+                        endRemoveRows();
+                }
+        }
 }
 
 void