Fix leaving rooms

This commit is contained in:
Nicolas Werner 2021-05-22 11:23:16 +02:00
parent f3d956aebc
commit d307f24adf
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
2 changed files with 12 additions and 1 deletions

View file

@ -46,7 +46,7 @@ Page {
states: [ states: [
State { State {
name: "highlight" name: "highlight"
when: hovered.hovered when: hovered.hovered && !(TimelineManager.timeline && model.roomId == TimelineManager.timeline.roomId())
PropertyChanges { PropertyChanges {
target: roomItem target: roomItem

View file

@ -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 void