aboutsummaryrefslogtreecommitdiff
path: root/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'Plugin')
-rw-r--r--Plugin/Admin.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Plugin/Admin.pm b/Plugin/Admin.pm
index b4c4768..c2c4f55 100644
--- a/Plugin/Admin.pm
+++ b/Plugin/Admin.pm
@@ -136,9 +136,14 @@ sub kick {
my ($self, $irc, $logger, $who, $where, $ided, $rest, @arguments) = @_;
return unless is_admin($logger, $who, $ided);
- return "Syntax: kick <channel> <nick> [reason]" unless @arguments >= 2;
+ return "Syntax: kick <channel> <nick> [reason]" unless
+ @arguments >= 2 and is_channel($arguments[0])
+ or @arguments >= 1 and is_channel($where->[0]);
+
+ if (is_channel($where->[0]) and not is_channel($arguments[0])) {
+ $rest = "$where->[0] $rest";
+ }
- # FIXME should use $where if it's a channel (?)
my ($channel, $kickee, undef, $reason) = $rest =~ /^(\S+)\s(\S+)((?:\s)(.*))?$/;
if ($channel and $kickee) {
my $nick = (split /!/, $who)[0];