From 02a343624e99c21f65bcd28a26b6978fd23840df Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 21 Jan 2019 18:07:00 +0200 Subject: [PATCH] Always emit part message (required for logging) Fixes #2988 --- src/plugins/irc-events/part.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/irc-events/part.js b/src/plugins/irc-events/part.js index 16a5e7e6..851f3b1e 100644 --- a/src/plugins/irc-events/part.js +++ b/src/plugins/irc-events/part.js @@ -13,6 +13,17 @@ module.exports = function(irc, network) { return; } + const user = chan.getUser(data.nick); + const msg = new Msg({ + type: Msg.Type.PART, + time: data.time, + text: data.message || "", + hostmask: data.ident + "@" + data.hostname, + from: user, + self: data.nick === irc.user.nick, + }); + chan.pushMessage(client, msg); + if (data.nick === irc.user.nick) { network.channels = _.without(network.channels, chan); chan.destroy(); @@ -21,17 +32,6 @@ module.exports = function(irc, network) { chan: chan.id, }); } else { - const user = chan.getUser(data.nick); - - const msg = new Msg({ - type: Msg.Type.PART, - time: data.time, - text: data.message || "", - hostmask: data.ident + "@" + data.hostname, - from: user, - }); - chan.pushMessage(client, msg); - chan.removeUser(user); client.emit("users", { chan: chan.id,