diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 4d1655872f..205eb10c4a 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -639,7 +639,9 @@ module.exports = React.createClass({ var rooms = MatrixClientPeg.get().getRooms(); for (var i = 0; i < rooms.length; ++i) { - notifCount += rooms[i].unread_notification_count; + if (rooms[i].unread_notification_count) { + notifCount += rooms[i].unread_notification_count; + } } this.favicon.badge(notifCount); document.title = (notifCount > 0 ? "["+notifCount+"] " : "")+"Vector"; diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index f60cc3a08a..9f85c053ee 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -159,7 +159,15 @@ module.exports = React.createClass({ onRoomReceipt: function(receiptEvent, room) { // because if we read a notification, it will affect notification count - this.refreshRoomList(); + // only bother updating if there's a receipt from us + var receiptKeys = Object.keys(receiptEvent.getContent()); + for (var i = 0; i < receiptKeys.length; ++i) { + var rcpt = receiptEvent.getContent()[receiptKeys[i]]; + if (rcpt['m.read'] && rcpt['m.read'][MatrixClientPeg.get().credentials.userId]) { + this.refreshRoomList(); + break; + } + } }, onRoomName: function(room) {