Fix a bug in notification.
This commit is contained in:
parent
31203235f2
commit
6dd33af0ca
|
@ -77,6 +77,7 @@ void RoomListModel::connectRoomSignals(SpectralRoom* room) {
|
||||||
connect(room, &Room::addedMessages, this,
|
connect(room, &Room::addedMessages, this,
|
||||||
[=] { refresh(room, {LastEventRole}); });
|
[=] { refresh(room, {LastEventRole}); });
|
||||||
connect(room, &Room::notificationCountChanged, this, [=] {
|
connect(room, &Room::notificationCountChanged, this, [=] {
|
||||||
|
if (room->notificationCount() == 0) return;
|
||||||
if (room->timelineSize() == 0) return;
|
if (room->timelineSize() == 0) return;
|
||||||
const RoomEvent* lastEvent = room->messageEvents().rbegin()->get();
|
const RoomEvent* lastEvent = room->messageEvents().rbegin()->get();
|
||||||
if (lastEvent->isStateEvent()) return;
|
if (lastEvent->isStateEvent()) return;
|
||||||
|
|
Loading…
Reference in New Issue