Commit 478653ae authored by JC Brand's avatar JC Brand

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

parent 4186bf3c
...@@ -2707,11 +2707,15 @@ ...@@ -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++;
} }
} }
......
...@@ -4,7 +4,10 @@ Changelog ...@@ -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]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment