From c0f1ae013346b32480c217729727d899be4e46cb Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 6 Jan 2016 18:29:27 +0000 Subject: [PATCH 1/3] Use Unread to compute unread status of a room (which uses read receipts). --- src/components/structures/RoomSubList.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 0a0660f8f8..48dd334e17 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -20,7 +20,7 @@ var React = require('react'); var DropTarget = require('react-dnd').DropTarget; var sdk = require('matrix-react-sdk') var dis = require('matrix-react-sdk/lib/dispatcher'); -var UnreadStatus = require('matrix-react-sdk/lib/UnreadStatus'); +var Unread = require('matrix-react-sdk/lib/Unread'); // turn this on for drop & drag console debugging galore var debug = false; @@ -62,7 +62,6 @@ var RoomSubList = React.createClass({ editable: React.PropTypes.bool, order: React.PropTypes.string.isRequired, selectedRoom: React.PropTypes.string.isRequired, - activityMap: React.PropTypes.object.isRequired, startAsHidden: React.PropTypes.bool, showSpinner: React.PropTypes.bool, // true to show a spinner if 0 elements when expanded @@ -108,8 +107,7 @@ var RoomSubList = React.createClass({ tsOfNewestEvent: function(room) { for (var i = room.timeline.length - 1; i >= 0; --i) { var ev = room.timeline[i]; - // logic copied from RoomList.js for when we do/don't highlight - if (UnreadStatus.eventTriggersUnreadCount(ev)) { + if (Unread.eventTriggersUnreadCount(ev)) { return ev.getTs(); } } @@ -254,7 +252,7 @@ var RoomSubList = React.createClass({ key={ room.roomId } collapsed={ self.props.collapsed || false} selected={ selected } - unread={ self.props.activityMap[room.roomId] === 1 } + unread={ Unread.doesRoomHaveUnreadMessages(room) } highlight={ room.unread_notification_count > 0 || self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' } incomingCall={ self.props.incomingCall && (self.props.incomingCall.roomId === room.roomId) ? self.props.incomingCall : null } From ac2e69ba280847903e5155fc871219e4c5874294 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 20 Jan 2016 17:20:19 +0000 Subject: [PATCH 2/3] Use new unread count methods --- src/components/structures/RoomSubList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 48dd334e17..b9812a7746 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -253,7 +253,7 @@ var RoomSubList = React.createClass({ collapsed={ self.props.collapsed || false} selected={ selected } unread={ Unread.doesRoomHaveUnreadMessages(room) } - highlight={ room.unread_notification_count > 0 || self.props.label === 'Invites' } + highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' } incomingCall={ self.props.incomingCall && (self.props.incomingCall.roomId === room.roomId) ? self.props.incomingCall : null } /> From d979511696b405ca4910b856fc2faee8722a9efc Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 20 Jan 2016 17:20:34 +0000 Subject: [PATCH 3/3] Re-remove extra icons as they break favico --- vector/index.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vector/index.html b/vector/index.html index f926cea58d..777c2a9710 100644 --- a/vector/index.html +++ b/vector/index.html @@ -13,10 +13,6 @@ - - - -