From fd09d5c57049083719b59a3bbf65a33015d15269 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 17 May 2016 11:14:12 +0100 Subject: [PATCH] switch badge count to per-conversation, and add per-room badges --- src/components/structures/MatrixChat.js | 7 +++++-- src/components/views/rooms/RoomTile.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 08b7866b1c..255f7c9b92 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -999,9 +999,12 @@ module.exports = React.createClass({ var rooms = MatrixClientPeg.get().getRooms(); for (var i = 0; i < rooms.length; ++i) { if (rooms[i].hasMembershipState(MatrixClientPeg.get().credentials.userId, 'invite')) { - ++notifCount; + notifCount++; } else if (rooms[i].getUnreadNotificationCount()) { - notifCount += rooms[i].getUnreadNotificationCount(); + // if we were summing unread notifs: + // notifCount += rooms[i].getUnreadNotificationCount(); + // instead, we just count the number of rooms with notifs. + notifCount++; } } try { diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js index 69a945df33..55971cdd60 100644 --- a/src/components/views/rooms/RoomTile.js +++ b/src/components/views/rooms/RoomTile.js @@ -83,7 +83,7 @@ module.exports = React.createClass({ name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon var badge; if (this.props.highlight || notificationCount > 0) { - badge =
; + badge =
{ notificationCount ? notificationCount : '!' }
; } /* if (this.props.highlight) { @@ -132,9 +132,9 @@ module.exports = React.createClass({
- { badge }
{ label } + { badge } { incomingCallBox }
));