summary refs log tree commit diff
path: root/src/RoomList.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-11-24 00:10:58 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-11-24 00:10:58 +0200
commit0f363b5f4424cc4cdf0e36d7aa5b62b8e8ea52bc (patch)
treeb216baa489755bbb3343f350aa6c6d3e17725fba /src/RoomList.cc
parentFix qss formatting (diff)
downloadnheko-0f363b5f4424cc4cdf0e36d7aa5b62b8e8ea52bc.tar.xz
Send read receipts
Automatically dismiss unread notifications when the window regains
focus.

fixes #111
fixes #68
Diffstat (limited to 'src/RoomList.cc')
-rw-r--r--src/RoomList.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/RoomList.cc b/src/RoomList.cc

index b1d3a9ca..402633c3 100644 --- a/src/RoomList.cc +++ b/src/RoomList.cc
@@ -204,6 +204,18 @@ RoomList::sync(const QMap<QString, RoomState> &states, } void +RoomList::clearRoomMessageCount(const QString &room_id) +{ + if (!rooms_.contains(room_id)) + return; + + auto room = rooms_[room_id]; + room->clearUnreadMessageCount(); + + calculateUnreadMessageCount(); +} + +void RoomList::highlightSelectedRoom(const QString &room_id) { emit roomChanged(room_id); @@ -213,9 +225,7 @@ RoomList::highlightSelectedRoom(const QString &room_id) return; } - // TODO: Send a read receipt for the last event. - auto room = rooms_[room_id]; - room->clearUnreadMessageCount(); + clearRoomMessageCount(room_id); calculateUnreadMessageCount();