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

@ -355,8 +355,9 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
auto roomInfo = cache::singleRoomInfo(room_id_.toStdString());
this->isSpace_ = roomInfo.is_space;
this->notification_count =
isSpace_ ? utils::getChildNotificationsForSpace(room_id_) : roomInfo.notification_count;
this->highlight_count = roomInfo.highlight_count;
isSpace_ ? utils::getChildNotificationsForSpace(room_id_).first : roomInfo.notification_count;
this->highlight_count =
isSpace_ ? utils::getChildNotificationsForSpace(room_id_).second : roomInfo.highlight_count;
lastMessage_.timestamp = roomInfo.approximate_last_modification_ts;
// this connection will simplify adding the plainRoomNameChanged() signal everywhere that it
@ -365,7 +366,9 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj
if (isSpace_)
connect(ChatPage::instance(), &ChatPage::unreadMessages, this, [this](int) {
notification_count = utils::getChildNotificationsForSpace(room_id_);
auto temp{utils::getChildNotificationsForSpace(room_id_)};
notification_count = temp.first;
highlight_count = temp.second;
emit notificationsChanged();
});