From 00af792899eb7b28c5a3eb121a3f6d9add137566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Bonveh=C3=AD?= Date: Wed, 10 Dec 2014 22:42:09 -0300 Subject: [PATCH] Unified pending/requesting checking --- converse.js | 12 ++---------- spec/controlbox.js | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/converse.js b/converse.js index df8a66466..fbb625b06 100644 --- a/converse.js +++ b/converse.js @@ -3228,7 +3228,8 @@ showInRoster: function () { var chatStatus = this.get('chat_status'); - if (converse.show_only_online_users && chatStatus !== 'online') { + if ((converse.show_only_online_users && chatStatus !== 'online') + || (converse.hide_offline_users && chatStatus === 'offline')) { // If pending or requesting, show if ((this.get('ask') === 'subscribe') || (this.get('subscription') === 'from') @@ -3237,15 +3238,6 @@ } return false; } - if (converse.hide_offline_users && chatStatus === 'offline') { - // If pending or requesting, show - if ((this.get('ask') === 'subscribe') - || (this.get('subscription') === 'from') - || (this.get('requesting') === true)) { - return true; - } - return false; - } return true; } }); diff --git a/spec/controlbox.js b/spec/controlbox.js index f8083846f..d87fb7bbf 100644 --- a/spec/controlbox.js +++ b/spec/controlbox.js @@ -436,7 +436,6 @@ }); waits(50); spyOn(this.rosterview, 'update').andCallThrough(); - waits(50); runs($.proxy(function () { expect(this.rosterview.$el.is(':visible')).toEqual(true); expect(this.rosterview.update).toHaveBeenCalled();