Merge pull request #3789 from thelounge/xpaw/fix-unhandled-chan
Fix sending unhandled numerics to target channel
This commit is contained in:
commit
464c54b2cb
@ -8,11 +8,13 @@ module.exports = function(irc, network) {
|
||||
irc.on("unknown command", function(command) {
|
||||
let target = network.channels[0];
|
||||
|
||||
if (command.params.length > 0) {
|
||||
// Do not display users own name
|
||||
if (command.params[0] === network.irc.user.nick) {
|
||||
if (command.params.length > 0 && command.params[0] === network.irc.user.nick) {
|
||||
command.params.shift();
|
||||
} else {
|
||||
}
|
||||
|
||||
// Check the length again because we may shift the nick above
|
||||
if (command.params.length > 0) {
|
||||
// If this numeric starts with a channel name that exists
|
||||
// put this message in that channel
|
||||
const channel = network.getChannel(command.params[0]);
|
||||
@ -21,7 +23,6 @@ module.exports = function(irc, network) {
|
||||
target = channel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
target.pushMessage(
|
||||
client,
|
||||
|
Loading…
Reference in New Issue
Block a user