Merge pull request #2020 from thelounge/xpaw/fix-1991
Wait for server response when parting channels
This commit is contained in:
commit
93265ef830
@ -27,18 +27,18 @@ exports.input = function(network, chan, cmd, args) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If target is not a channel or we are not connected, instantly remove the channel
|
||||||
|
// Otherwise send part to the server and wait for response
|
||||||
|
if (target.type !== Chan.Type.CHANNEL || !network.irc || !network.irc.connection || !network.irc.connection.connected) {
|
||||||
network.channels = _.without(network.channels, target);
|
network.channels = _.without(network.channels, target);
|
||||||
target.destroy();
|
target.destroy();
|
||||||
this.emit("part", {
|
this.emit("part", {
|
||||||
chan: target.id,
|
chan: target.id,
|
||||||
});
|
});
|
||||||
this.save();
|
this.save();
|
||||||
|
} else {
|
||||||
if (target.type === Chan.Type.CHANNEL) {
|
|
||||||
if (network.irc) {
|
|
||||||
network.irc.part(target.name, partMessage);
|
network.irc.part(target.name, partMessage);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user