diff --git a/client/startup/startup.coffee b/client/startup/startup.coffee index 58ff5cbe5d9a..20b1783f4203 100644 --- a/client/startup/startup.coffee +++ b/client/startup/startup.coffee @@ -81,15 +81,15 @@ Meteor.startup -> KonchatNotification.newMessage() Tracker.autorun -> - unreadCount = 0 - subscriptions = ChatSubscription.find({}, { fields: { unread: 1 } }) - (unreadCount += r.unread) for r in subscriptions.fetch() + mentionsCount = 0 + subscriptions = ChatSubscription.find({}, { fields: { mentions: 1 } }) + (mentionsCount += r.mentions) for r in subscriptions.fetch() rxFavico.set 'type', 'warn' - rxFavico.set 'count', unreadCount + rxFavico.set 'count', mentionsCount - if unreadCount > 0 - document.title = '(' + unreadCount + ') Rocket.Chat' + if mentionsCount > 0 + document.title = '(' + mentionsCount + ') Rocket.Chat' else document.title = 'Rocket.Chat' diff --git a/client/stylesheets/base.less b/client/stylesheets/base.less index 55f112263d8b..923fd6e63008 100644 --- a/client/stylesheets/base.less +++ b/client/stylesheets/base.less @@ -1159,7 +1159,7 @@ a.github-fork { } } } - .unread { + .mentions { background-color: #1dce73; min-width: 15px; padding: 0 2px; @@ -1208,7 +1208,11 @@ a.github-fork { background-color: transparent; } } - &.has-unread { + &.has-unread a, &.has-mentions a { + font-weight: bold; + color: #fff; + } + &.has-mentions { .opt { opacity: 0; } diff --git a/client/views/app/sideNav/chatRoomItem.coffee b/client/views/app/sideNav/chatRoomItem.coffee index d87326a7e9e3..f61948f912b3 100644 --- a/client/views/app/sideNav/chatRoomItem.coffee +++ b/client/views/app/sideNav/chatRoomItem.coffee @@ -5,6 +5,12 @@ Template.chatRoomItem.helpers else if Router.current().params._id is this.rid and this.unread > 0 Meteor.call 'readMessages', this.rid + mentions: -> + if (not Router.current().params._id) or Router.current().params._id isnt this.rid + return this.mentions + else if Router.current().params._id is this.rid and this.mentions > 0 + Meteor.call 'readMessages', this.rid + isDirectRoom: -> return this.t is 'd' diff --git a/client/views/app/sideNav/chatRoomItem.html b/client/views/app/sideNav/chatRoomItem.html index 348ef065994b..538820186be0 100644 --- a/client/views/app/sideNav/chatRoomItem.html +++ b/client/views/app/sideNav/chatRoomItem.html @@ -1,8 +1,8 @@