summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-07-15 16:19:06 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-07-15 16:19:06 +0200
commitf76fd4ca837ab7dcf17d7889cc555b20e5b9d654 (patch)
tree909a783bdbd709ef8b7afbdbbae1d116ff135f55 /src/timeline/TimelineModel.cpp
parentMerge remote-tracking branch 'origin/perSpaceNotifs' into perSpaceNotifs (diff)
downloadnheko-f76fd4ca837ab7dcf17d7889cc555b20e5b9d654.tar.xz
WIP
Diffstat (limited to '')
-rw-r--r--src/timeline/TimelineModel.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index db56ac52..9b48a878 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -364,25 +364,11 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj { this->isEncrypted_ = cache::isRoomEncrypted(room_id_.toStdString()); - auto roomInfo = cache::singleRoomInfo(room_id_.toStdString()); - this->isSpace_ = roomInfo.is_space; - this->notification_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 - // needs to be - connect(this, &TimelineModel::roomNameChanged, this, &TimelineModel::plainRoomNameChanged); - - if (isSpace_) - connect(ChatPage::instance(), &ChatPage::unreadMessages, this, [this](int) { - auto temp{utils::getChildNotificationsForSpace(room_id_)}; - notification_count = temp.first; - highlight_count = temp.second; - emit notificationsChanged(); - }); + auto roomInfo = cache::singleRoomInfo(room_id_.toStdString()); + this->isSpace_ = roomInfo.is_space; + this->notification_count = roomInfo.notification_count; + this->highlight_count = roomInfo.highlight_count; + lastMessage_.timestamp = roomInfo.approximate_last_modification_ts; connect( this,