summary refs log tree commit diff
path: root/src/timeline/TimelineView.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-15 21:58:57 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-15 21:58:57 +0200
commit86280098b49709fed6cc850f8ba28dac0b29c216 (patch)
treec308583ee8dee63f21984ff4ab4d165e350c8128 /src/timeline/TimelineView.cc
parentSimplify variant access with std::visit (diff)
downloadnheko-86280098b49709fed6cc850f8ba28dac0b29c216.tar.xz
Implement server-side notification count
Diffstat (limited to 'src/timeline/TimelineView.cc')
-rw-r--r--src/timeline/TimelineView.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc

index d32832a4..063b9f9d 100644 --- a/src/timeline/TimelineView.cc +++ b/src/timeline/TimelineView.cc
@@ -290,11 +290,9 @@ TimelineView::renderTopEvents(const std::vector<TimelineEvent> &events) lastSender_ = items.at(0)->descriptionMessage().userid; } -int +void TimelineView::addEvents(const mtx::responses::Timeline &timeline) { - int message_count = 0; - if (isInitialSync) { prev_batch_token_ = QString::fromStdString(timeline.prev_batch); isInitialSync = false; @@ -306,8 +304,8 @@ TimelineView::addEvents(const mtx::responses::Timeline &timeline) bottomMessages_.push_back(e); // Calculate notifications. - if (isNotifiable(e)) - message_count += 1; + /* if (isNotifiable(e)) */ + /* sendNotification() */ } if (!bottomMessages_.empty()) @@ -324,8 +322,6 @@ TimelineView::addEvents(const mtx::responses::Timeline &timeline) if (isActiveWindow()) readLastEvent(); } - - return message_count; } inline bool @@ -685,12 +681,8 @@ TimelineView::showEvent(QShowEvent *event) bool TimelineView::event(QEvent *event) { - if (event->type() == QEvent::WindowActivate) { - QTimer::singleShot(1000, this, [=]() { - emit clearUnreadMessageCount(room_id_); - readLastEvent(); - }); - } + if (event->type() == QEvent::WindowActivate) + readLastEvent(); return QWidget::event(event); }