Add space notifications to room list
This commit is contained in:
parent
e7c24b094f
commit
169384f0fa
7 changed files with 98 additions and 69 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include <cmark.h>
|
||||
|
||||
#include "Cache.h"
|
||||
#include "Cache_p.h"
|
||||
#include "Config.h"
|
||||
#include "EventAccessors.h"
|
||||
#include "Logging.h"
|
||||
|
|
@ -880,3 +881,17 @@ utils::markRoomAsDirect(QString roomid, std::vector<RoomMember> members)
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
int
|
||||
utils::getChildNotificationsForSpace(const QString &spaceId)
|
||||
{
|
||||
auto children = cache::getRoomInfo(cache::client()->getChildRoomIds(spaceId.toStdString()));
|
||||
int total{0};
|
||||
for (const auto &[childId, child] : children) {
|
||||
if (child.is_space)
|
||||
total += utils::getChildNotificationsForSpace(childId);
|
||||
else
|
||||
total += child.notification_count;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue