Bugfix. Wrong number of online contacts shown. Fixes #97

This commit is contained in:
JC Brand 2013-12-18 16:48:02 +02:00
parent 4186bf3ca3
commit 478653aebd
2 changed files with 8 additions and 1 deletions

View File

@ -2707,11 +2707,15 @@
getNumOnlineContacts: function () { getNumOnlineContacts: function () {
var count = 0, var count = 0,
ignored = ['offline', 'unavailable'],
models = this.models, models = this.models,
models_length = models.length, models_length = models.length,
i; i;
if (converse.show_only_online_users) {
ignored = _.union(ignored, ['dnd', 'xa', 'away']);
}
for (i=0; i<models_length; i++) { for (i=0; i<models_length; i++) {
if (_.indexOf(['offline', 'unavailable'], models[i].get('chat_status')) === -1) { if (_.indexOf(ignored, models[i].get('chat_status')) === -1) {
count++; count++;
} }
} }

View File

@ -4,7 +4,10 @@ Changelog
0.7.2 (Unreleased) 0.7.2 (Unreleased)
------------------ ------------------
.. note:: This release contains an important security fix.
* #48 Add event emitter support and emit events. [jcbrand] * #48 Add event emitter support and emit events. [jcbrand]
* #97 Wrong number of online contacts shown with config option ``show_only_online_users``. [jcbrand]
* #100 Make the fetching of vCards optional (enabled by default). [jcbrand] * #100 Make the fetching of vCards optional (enabled by default). [jcbrand]
* Sanitize message text to avoid Javascript injection attacks. Thanks to hejsan for reporting. [jcbrand] * Sanitize message text to avoid Javascript injection attacks. Thanks to hejsan for reporting. [jcbrand]