Skip to content

Commit

Permalink
Fix argument parsing for WHOIS
Browse files Browse the repository at this point in the history
The previous behavior breaks catgirl, and probably other clients,
which send WHOIS :nick.  I can't see any interpretation of the spec
where that's wrong and the previous behavior is correct.
  • Loading branch information
tokenrove authored and jkominek committed Jul 28, 2021
1 parent 9c1c860 commit 6871126
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions User.pm
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,13 @@ sub handle_invite {
# WHOIS server.foo.bar nick1,nick2,..,nickn-1,nickn
# WHOIS nick1,nick2,..,nickn-1,nickn
sub handle_whois {
my $this = shift;
my($command,@excess) = split(/\s+/,shift);
my ($this,$dummy,@args) = (shift,shift,shift);

if($excess[1]) {
if(length(@args) > 1) {
# They're trying to request the information
# from another server.
} else {
my @targets = split(/,/,$excess[0]);
my @targets = split(/,/,$args[0]);
foreach my $target (@targets) {
my $user = Utils::lookupuser($target);
if(defined($user) && $user->isa("User")) {
Expand Down Expand Up @@ -439,7 +438,7 @@ sub handle_whois {
$this->sendnumeric($this->server,401,$target,"No suck nick");
}
}
$this->sendnumeric($this->server,318,$excess[0],"End of /WHOIS list.");
$this->sendnumeric($this->server,318,$args[0],"End of /WHOIS list.");
}
}

Expand Down

0 comments on commit 6871126

Please sign in to comment.