summary refs log tree commit diff
path: root/src/timeline/CommunitiesModel.cpp
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2022-04-25 20:57:18 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2022-06-29 22:04:37 -0400
commit4428e0e0b87f710501fb8210b8c310204bf3603e (patch)
tree51ab56981055d100b78abd0af90b593605c1fc79 /src/timeline/CommunitiesModel.cpp
parentAdd notifications to all sidebar items (diff)
downloadnheko-4428e0e0b87f710501fb8210b8c310204bf3603e.tar.xz
make lint
Diffstat (limited to 'src/timeline/CommunitiesModel.cpp')
-rw-r--r--src/timeline/CommunitiesModel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/timeline/CommunitiesModel.cpp b/src/timeline/CommunitiesModel.cpp

index 34da6157..8e1cf140 100644 --- a/src/timeline/CommunitiesModel.cpp +++ b/src/timeline/CommunitiesModel.cpp
@@ -20,7 +20,9 @@ CommunitiesModel::CommunitiesModel(QObject *parent) connect(ChatPage::instance(), &ChatPage::unreadMessages, this, [this](int) { // Simply updating every space is easier than tracking which ones need updated. if (!spaces_.empty()) - emit dataChanged(index(0, 0), index(spaces_.size() + tags_.size() + 1, 0), {Roles::UnreadMessages, Roles::HasLoudNotification}); + emit dataChanged(index(0, 0), + index(spaces_.size() + tags_.size() + 1, 0), + {Roles::UnreadMessages, Roles::HasLoudNotification}); }); } @@ -211,14 +213,16 @@ CommunitiesModel::data(const QModelIndex &index, int role) const int total{0}; auto rooms{cache::joinedRooms()}; for (const auto &[roomid, info] : cache::getRoomInfo(rooms)) - if (std::find(std::begin(info.tags), std::end(info.tags), tag.toStdString()) != std::end(info.tags)) + if (std::find(std::begin(info.tags), std::end(info.tags), tag.toStdString()) != + std::end(info.tags)) total += info.notification_count; return total; } case CommunitiesModel::Roles::HasLoudNotification: { auto rooms{cache::joinedRooms()}; for (const auto &[roomid, info] : cache::getRoomInfo(rooms)) - if (std::find(std::begin(info.tags), std::end(info.tags), tag.toStdString()) != std::end(info.tags)) + if (std::find(std::begin(info.tags), std::end(info.tags), tag.toStdString()) != + std::end(info.tags)) if (info.highlight_count > 0) return true; return false;