summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-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,