Merge remote-tracking branch 'origin/perSpaceNotifs' into perSpaceNotifs
This commit is contained in:
commit
aa63e50cea
12 changed files with 374 additions and 124 deletions
|
|
@ -364,16 +364,26 @@ 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 = roomInfo.notification_count;
|
||||
this->highlight_count = roomInfo.highlight_count;
|
||||
lastMessage_.timestamp = roomInfo.approximate_last_modification_ts;
|
||||
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();
|
||||
});
|
||||
|
||||
connect(
|
||||
this,
|
||||
&TimelineModel::redactionFailed,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue