Merge pull request #2989 from thelounge/xpaw/fix-2988

Always emit part message (required for logging)
This commit is contained in:
Pavel Djundik 2019-01-28 00:56:11 +02:00 committed by GitHub
commit ba397c158a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,17 @@ module.exports = function(irc, network) {
return; 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) { if (data.nick === irc.user.nick) {
network.channels = _.without(network.channels, chan); network.channels = _.without(network.channels, chan);
chan.destroy(); chan.destroy();
@ -21,17 +32,6 @@ module.exports = function(irc, network) {
chan: chan.id, chan: chan.id,
}); });
} else { } 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); chan.removeUser(user);
client.emit("users", { client.emit("users", {
chan: chan.id, chan: chan.id,