From 0d73046a81c4adc81f2276c21d8c189139268589 Mon Sep 17 00:00:00 2001 From: Darren Date: Fri, 27 Jun 2014 23:31:33 +0100 Subject: [PATCH] Showing user quits in the query panel #538 --- client/src/models/network.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/client/src/models/network.js b/client/src/models/network.js index 9362a10..cc51bf5 100644 --- a/client/src/models/network.js +++ b/client/src/models/network.js @@ -356,11 +356,20 @@ 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}); + } } }); } -- 2.25.1