From 14c2cf6b0bf1b26d053d28ddf3ccd1a509828f23 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 2 Nov 2019 16:53:41 +0200 Subject: [PATCH] Remove away message from channels Fixes #3026 --- src/plugins/irc-events/away.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/plugins/irc-events/away.js b/src/plugins/irc-events/away.js index c9e395bc..b82ae66f 100644 --- a/src/plugins/irc-events/away.js +++ b/src/plugins/irc-events/away.js @@ -29,7 +29,7 @@ module.exports = function(irc, network) { let user; switch (chan.type) { - case Chan.Type.QUERY: + case Chan.Type.QUERY: { if (data.nick.toLowerCase() !== chan.name.toLowerCase()) { return; } @@ -44,9 +44,19 @@ module.exports = function(irc, network) { user = chan.getUser(data.nick); - break; + const msg = new Msg({ + type: type, + text: away || "", + time: data.time, + from: user, + }); - case Chan.Type.CHANNEL: + chan.pushMessage(client, msg); + + break; + } + + case Chan.Type.CHANNEL: { user = chan.findUser(data.nick); if (!user || user.away === away) { @@ -56,19 +66,8 @@ module.exports = function(irc, network) { user.away = away; break; - - default: - return; + } } - - const msg = new Msg({ - type: type, - text: away || "", - time: data.time, - from: user, - }); - - chan.pushMessage(client, msg); }); } };