Add loud notifications for spaces

This commit is contained in:
Loren Burkholder 2022-04-20 21:30:16 -04:00
parent 169384f0fa
commit e446e3d679
6 changed files with 32 additions and 16 deletions

View file

@ -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;
}