Add loud notifications for spaces
This commit is contained in:
parent
169384f0fa
commit
e446e3d679
6 changed files with 32 additions and 16 deletions
|
|
@ -882,16 +882,20 @@ utils::markRoomAsDirect(QString roomid, std::vector<RoomMember> members)
|
|||
});
|
||||
}
|
||||
|
||||
int
|
||||
QPair<int, int>
|
||||
utils::getChildNotificationsForSpace(const QString &spaceId)
|
||||
{
|
||||
auto children = cache::getRoomInfo(cache::client()->getChildRoomIds(spaceId.toStdString()));
|
||||
int total{0};
|
||||
QPair<int, int> retVal;
|
||||
for (const auto &[childId, child] : children) {
|
||||
if (child.is_space)
|
||||
total += utils::getChildNotificationsForSpace(childId);
|
||||
else
|
||||
total += child.notification_count;
|
||||
if (child.is_space) {
|
||||
auto temp{utils::getChildNotificationsForSpace(childId)};
|
||||
retVal.first += temp.first;
|
||||
retVal.second += temp.second;
|
||||
} else {
|
||||
retVal.first += child.notification_count;
|
||||
retVal.second += child.highlight_count;
|
||||
}
|
||||
}
|
||||
return total;
|
||||
return retVal;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue