[gnome-shell] messageTray: add an indicatorCount property



commit bdbea2463b6cdfacbd6cbc78ae1b3f03b86abd1e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Feb 28 21:25:05 2013 -0500

    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(+), 0 deletions(-)
---
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index 72df82d..b07ea95 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 14c55db..2df4abc 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;
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]