Sometimes the bot may receive incomplete or malformed mode lines. This
can be seen for example by kicking repeatedly and at very short
intervals the bot from a channel with +l set to some numbers (at least
on freenode).
We (don't) handle these malformed modelines by skipping them rather than
crashing.
data[:modes].last << arg
end
}
- else
+ when Channel
# array of indices in data[:modes] where parameters
# are needed
who_wants_params = []
getting_args = true unless who_wants_params.empty?
end
end
+ unless who_wants_params.empty?
+ warning "Unhandled malformed modeline #{data[:modestring]} (unexpected empty arguments)"
+ return
+ end
data[:modes].each { |mode|
set, key, val = mode
data[:target].mode[key].send(set)
end
}
+ else
+ warning "Ignoring #{data[:modestring]} for unrecognized target #{argv[0]} (#{data[:target].inspect})"
end
end
end