Add a button to mark spaces as read
[BUG: 508122](https://bugs.kde.org/show_bug.cgi?id=508122)
This commit is contained in:
committed by
Joshua Goins
parent
fb8ee02e3b
commit
ade5750550
@@ -157,12 +157,14 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
||||
if (isSpace()) {
|
||||
Q_EMIT childrenNotificationCountChanged();
|
||||
Q_EMIT childrenHaveHighlightNotificationsChanged();
|
||||
Q_EMIT spaceHasUnreadMessagesChanged();
|
||||
}
|
||||
});
|
||||
connect(&SpaceHierarchyCache::instance(), &SpaceHierarchyCache::spaceNotificationCountChanged, this, [this](const QStringList &spaces) {
|
||||
if (spaces.contains(id())) {
|
||||
Q_EMIT childrenNotificationCountChanged();
|
||||
Q_EMIT childrenHaveHighlightNotificationsChanged();
|
||||
Q_EMIT spaceHasUnreadMessagesChanged();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1906,4 +1908,20 @@ void NeoChatRoom::invalidateLastUnreadHighlightId(const QString &fromEventId, co
|
||||
}
|
||||
}
|
||||
|
||||
bool NeoChatRoom::spaceHasUnreadMessages() const
|
||||
{
|
||||
if (!isSpace()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return SpaceHierarchyCache::instance().spaceHasUnreadMessages(id());
|
||||
}
|
||||
|
||||
void NeoChatRoom::markAllChildrenMessagesAsRead()
|
||||
{
|
||||
if (isSpace()) {
|
||||
SpaceHierarchyCache::instance().markAllChildrenMessagesAsRead(id());
|
||||
}
|
||||
};
|
||||
|
||||
#include "moc_neochatroom.cpp"
|
||||
|
||||
Reference in New Issue
Block a user