diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-05-22 11:23:16 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-05-22 11:23:16 +0200 |
commit | d307f24adf346ec3fe41d40a599db98d7eb435cf (patch) | |
tree | 43dffe58313eafb03592f5dfac3c6d5507278d8f /src/timeline/RoomlistModel.cpp | |
parent | Fix emoji in new RoomList (diff) | |
download | nheko-d307f24adf346ec3fe41d40a599db98d7eb435cf.tar.xz |
Fix leaving rooms
Diffstat (limited to 'src/timeline/RoomlistModel.cpp')
-rw-r--r-- | src/timeline/RoomlistModel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 |