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
This commit is contained in:
Cosimo Cecchi 2013-02-28 21:25:05 -05:00
parent 8fb2263471
commit bdbea2463b
2 changed files with 9 additions and 0 deletions

View File

@ -640,6 +640,10 @@ const ChatSource = new Lang.Class({
return this._pendingMessages.length;
},
get indicatorCount() {
return this.count;
},
get unseenCount() {
return this.count;
},

View File

@ -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;
},