Properly parse NICK and update chanusers.
This commit is contained in:
1 parent
502ba7cb1d
commit
e061a2ca8c
2 files changed
+12
-2
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* Properly parse NICK and update chanusers.
|
||||||
* Added --enable-ssl to ./install for the future SSL support.
|
* Added --enable-ssl to ./install for the future SSL support.
|
||||||
* Added chanstatus-based permissions. This works via
|
* Added chanstatus-based permissions. This works via
|
||||||
user:chanstatus.
|
user:chanstatus.
|
||||||
|
|||||||
+11
-2
@@ -329,7 +329,8 @@ sub cjoin
|
|||||||
sub nick
|
sub nick
|
||||||
{
|
{
|
||||||
my ($svr, ($uex, undef, $nex)) = @_;
|
my ($svr, ($uex, undef, $nex)) = @_;
|
||||||
|
$nex = substr($nex, 1);
|
||||||
|
|
||||||
my %src = API::IRC::usrc(substr($uex, 1));
|
my %src = API::IRC::usrc(substr($uex, 1));
|
||||||
|
|
||||||
# Check if this is coming from ourselves.
|
# Check if this is coming from ourselves.
|
||||||
@@ -339,7 +340,15 @@ sub nick
|
|||||||
delete $botnick{$svr}{newnick} if (defined $botnick{$svr}{newnick});
|
delete $botnick{$svr}{newnick} if (defined $botnick{$svr}{newnick});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# It isn't. Trigger on_nick.
|
# It isn't. Update chanusers and trigger on_nick.
|
||||||
|
foreach my $chk (keys %{ $chanusers{$svr} }) {
|
||||||
|
if (defined $chanusers{$svr}{$chk}{$src{nick}}) {
|
||||||
|
print "1\n";
|
||||||
|
$chanusers{$svr}{$chk}{$nex} = $chanusers{$svr}{$chk}{$src{nick}};
|
||||||
|
print "$nex set to $chanusers{$svr}{$chk}{$nex}\n";
|
||||||
|
delete $chanusers{$svr}{$chk}{$src{nick}};
|
||||||
|
}
|
||||||
|
}
|
||||||
API::Std::event_run("on_nick", ($svr, %src, $nex));
|
API::Std::event_run("on_nick", ($svr, %src, $nex));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user