From bdbea2463b6cdfacbd6cbc78ae1b3f03b86abd1e Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 28 Feb 2013 21:25:05 -0500 Subject: [PATCH] messageTray: add an indicatorCount property This filters out resident and transient notifications in the normal case, but just returns the number of unread messages for the Telepathy implementation. https://bugzilla.gnome.org/show_bug.cgi?id=687787 --- js/ui/components/telepathyClient.js | 4 ++++ js/ui/messageTray.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index 72df82d67..b07ea9516 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -640,6 +640,10 @@ const ChatSource = new Lang.Class({ return this._pendingMessages.length; }, + get indicatorCount() { + return this.count; + }, + get unseenCount() { return this.count; }, diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 14c55db63..2df4abc48 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1153,6 +1153,11 @@ const Source = new Lang.Class({ return this.notifications.length; }, + get indicatorCount() { + let notifications = this.notifications.filter(function(n) { return !n.isTransient && !n.resident; }); + return notifications.length; + }, + get unseenCount() { return this.notifications.filter(function(n) { return !n.acknowledged; }).length; },