Improve room settings dialog.

This commit is contained in:
Black
2020-01-22 20:37:27 -08:00
parent 09090f81f4
commit 6af7befd11
3 changed files with 208 additions and 174 deletions

View File

@@ -106,6 +106,21 @@ void RoomListModel::connectRoomSignals(SpectralRoom* room) {
sender->displayname(), room->eventToString(*lastEvent),
room->avatar(128));
});
connect(room, &Room::highlightCountChanged, this, [=] {
if (room->highlightCount() == 0)
return;
if (room->timelineSize() == 0)
return;
const RoomEvent* lastEvent = room->messageEvents().rbegin()->get();
if (lastEvent->isStateEvent())
return;
User* sender = room->user(lastEvent->senderId());
if (sender == room->localUser())
return;
emit newHighlight(room->id(), lastEvent->id(), room->displayName(),
sender->displayname(), room->eventToString(*lastEvent),
room->avatar(128));
});
connect(room, &Room::notificationCountChanged, this,
&RoomListModel::refreshNotificationCount);
}