Fix a bug in notification.

square-messages
Black Hat 2019-03-02 22:07:06 +08:00
parent 31203235f2
commit 6dd33af0ca
1 changed files with 1 additions and 0 deletions

View File

@ -77,6 +77,7 @@ void RoomListModel::connectRoomSignals(SpectralRoom* room) {
connect(room, &Room::addedMessages, this,
[=] { refresh(room, {LastEventRole}); });
connect(room, &Room::notificationCountChanged, this, [=] {
if (room->notificationCount() == 0) return;
if (room->timelineSize() == 0) return;
const RoomEvent* lastEvent = room->messageEvents().rbegin()->get();
if (lastEvent->isStateEvent()) return;