summary refs log tree commit diff
path: root/src/timeline/TimelineViewManager.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/TimelineViewManager.cc
parentSimplify variant access with std::visit (diff)
downloadnheko-86280098b49709fed6cc850f8ba28dac0b29c216.tar.xz
Implement server-side notification count
Diffstat (limited to 'src/timeline/TimelineViewManager.cc')
-rw-r--r--src/timeline/TimelineViewManager.cc19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/timeline/TimelineViewManager.cc b/src/timeline/TimelineViewManager.cc
index fdc3b9e2..7bee8869 100644
--- a/src/timeline/TimelineViewManager.cc
+++ b/src/timeline/TimelineViewManager.cc
@@ -159,10 +159,6 @@ TimelineViewManager::addRoom(const mtx::responses::JoinedRoom &room, const QStri
                 &TimelineView::updateLastTimelineMessage,
                 this,
                 &TimelineViewManager::updateRoomsLastMessage);
-        connect(view,
-                &TimelineView::clearUnreadMessageCount,
-                this,
-                &TimelineViewManager::clearRoomMessageCount);
 
         // Add the view in the widget stack.
         addWidget(view);
@@ -179,10 +175,6 @@ TimelineViewManager::addRoom(const QString &room_id)
                 &TimelineView::updateLastTimelineMessage,
                 this,
                 &TimelineViewManager::updateRoomsLastMessage);
-        connect(view,
-                &TimelineView::clearUnreadMessageCount,
-                this,
-                &TimelineViewManager::clearRoomMessageCount);
 
         // Add the view in the widget stack.
         addWidget(view);
@@ -201,16 +193,7 @@ TimelineViewManager::sync(const mtx::responses::Rooms &rooms)
 
                 auto view = views_.at(roomid);
 
-                int msgs_added = view->addEvents(it->second.timeline);
-
-                if (msgs_added > 0) {
-                        // TODO: When the app window gets active the current
-                        // unread count (if any) should be cleared.
-                        auto isAppActive = QApplication::activeWindow() != nullptr;
-
-                        if (roomid != active_room_ || !isAppActive)
-                                emit unreadMessages(roomid, msgs_added);
-                }
+                view->addEvents(it->second.timeline);
         }
 }