Sort rooms by last event, not unread count.

This commit is contained in:
Black Hat
2018-09-18 20:57:38 +08:00
parent 86ea5d02c1
commit 0361432c3d
5 changed files with 14 additions and 3 deletions

View File

@@ -163,6 +163,7 @@ QVariant RoomListModel::data(const QModelIndex& index, int role) const {
if (role == UnreadCountRole) return room->unreadCount();
if (role == HighlightCountRole) return room->highlightCount();
if (role == LastEventRole) return room->lastEvent();
if (role == LastActiveTimeRole) return room->lastActiveTime();
if (role == CurrentRoomRole) return QVariant::fromValue(room);
return QVariant();
}
@@ -196,6 +197,7 @@ QHash<int, QByteArray> RoomListModel::roleNames() const {
roles[UnreadCountRole] = "unreadCount";
roles[HighlightCountRole] = "highlightCount";
roles[LastEventRole] = "lastEvent";
roles[LastActiveTimeRole] = "lastActiveTime";
roles[CurrentRoomRole] = "currentRoom";
return roles;
}