From 86280098b49709fed6cc850f8ba28dac0b29c216 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 15 Feb 2018 21:58:57 +0200 Subject: Implement server-side notification count --- include/ChatPage.h | 2 ++ include/RoomInfoListItem.h | 2 +- include/RoomList.h | 1 - include/timeline/TimelineView.h | 3 +-- include/timeline/TimelineViewManager.h | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ChatPage.h b/include/ChatPage.h index f784231a..3a11f091 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -128,6 +128,8 @@ private: void updateUserMetadata(const std::vector &collection); void retryInitialSync(); + //! Update the room with the new notification count. + void updateRoomNotificationCount(const QString &room_id, uint16_t notification_count); QHBoxLayout *topLayout_; Splitter *splitter; diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index 4e3fe0ce..213f0479 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -68,7 +68,7 @@ public: RoomInfoListItem(QString room_id, mtx::responses::InvitedRoom room, QWidget *parent = 0); void updateUnreadMessageCount(int count); - void clearUnreadMessageCount(); + void clearUnreadMessageCount() { updateUnreadMessageCount(0); }; void setState(QSharedPointer state) { state_ = state; diff --git a/include/RoomList.h b/include/RoomList.h index 7ceffd22..bcac8094 100644 --- a/include/RoomList.h +++ b/include/RoomList.h @@ -76,7 +76,6 @@ public slots: void updateUnreadMessageCount(const QString &roomid, int count); void updateRoomDescription(const QString &roomid, const DescInfo &info); void closeJoinRoomDialog(bool isJoining, QString roomAlias); - void clearRoomMessageCount(const QString &room_id); protected: void paintEvent(QPaintEvent *event) override; diff --git a/include/timeline/TimelineView.h b/include/timeline/TimelineView.h index fb7c6485..6e1287c8 100644 --- a/include/timeline/TimelineView.h +++ b/include/timeline/TimelineView.h @@ -83,7 +83,7 @@ public: QWidget *parent = 0); // Add new events at the end of the timeline. - int addEvents(const mtx::responses::Timeline &timeline); + void addEvents(const mtx::responses::Timeline &timeline); void addUserMessage(mtx::events::MessageType ty, const QString &msg); template @@ -113,7 +113,6 @@ private slots: signals: void updateLastTimelineMessage(const QString &user, const DescInfo &info); - void clearUnreadMessageCount(const QString &room_id); protected: void paintEvent(QPaintEvent *event) override; diff --git a/include/timeline/TimelineViewManager.h b/include/timeline/TimelineViewManager.h index e3cc311e..74d8588c 100644 --- a/include/timeline/TimelineViewManager.h +++ b/include/timeline/TimelineViewManager.h @@ -57,7 +57,6 @@ public: signals: void clearRoomMessageCount(QString roomid); - void unreadMessages(QString roomid, int count); void updateRoomsLastMessage(const QString &user, const DescInfo &info); public slots: -- cgit 1.5.1