Showing user quits in the query panel #538
authorDarren <darren@darrenwhitlen.com>
Fri, 27 Jun 2014 22:31:33 +0000 (23:31 +0100)
committerDarren <darren@darrenwhitlen.com>
Fri, 27 Jun 2014 22:31:33 +0000 (23:31 +0100)
client/src/models/network.js

index 9362a10d14237e6d5ee5b0572a3c7e8ef2b2cef4..cc51bf5a222edfd4d8fdfc0a006866e2fb2da7bd 100644 (file)
         quit_options.time = event.time;
 
         $.each(this.panels.models, function (index, panel) {
-            if (!panel.isChannel()) return;
+            // Let any query panels know they quit
+            if (panel.isQuery() && panel.get('name').toLowerCase() === event.nick.toLowerCase()) {
+                panel.addMsg(' ', styleText('channel_quit', {
+                    nick: event.nick,
+                    text: translateText('client_models_channel_quit', [quit_options.message])
+                }), 'action quit', {time: quit_options.time});
+            }
 
-            member = panel.get('members').getByNick(event.nick);
-            if (member) {
-                panel.get('members').remove(member, {kiwi: quit_options});
+            // Remove the nick from any channels
+            if (panel.isChannel()) {
+                member = panel.get('members').getByNick(event.nick);
+                if (member) {
+                    panel.get('members').remove(member, {kiwi: quit_options});
+                }
             }
         });
     }