Просмотр исходного кода

Unified pending/requesting checking

Guillermo Bonvehí 10 лет назад
Родитель
Сommit
00af792899
2 измененных файлов с 2 добавлено и 11 удалено
  1. 2 10
      converse.js
  2. 0 1
      spec/controlbox.js

+ 2 - 10
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;
             }
         });

+ 0 - 1
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();