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,