* Added who() to API::IRC.

* Added hook on_whoreply.
* PRIVMSGs and NOTICEs that would cause a >512 bytes resulting message are now divided into multiple messages.
* Renamed botnick to botinfo.
This commit is contained in:
Elijah Perrault committed 2011-02-25 20:14:19 -07:00
1 parent 9c8200fb78
commit 8512ea129a
5 files changed
+116 -75

No files matched your search

+23
View File
@@ -51,6 +51,15 @@ hook_add("on_connect", "on_connect_modes", sub {
return 1;
});
# Self-WHO on connect.
hook_add('on_connect', 'on_connect_selfwho', sub {
my ($svr) = @_;
API::IRC::who($svr, $Proto::IRC::botinfo{$svr}{nick});
return 1;
});
# Plaintext auth.
hook_add("on_connect", "plaintext_auth", sub {
my ($svr) = @_;
@@ -114,6 +123,20 @@ hook_add("on_connect", "autojoin", sub {
return 1;
});
# WHO reply.
hook_add('on_whoreply', 'selfwho.getdata', sub {
my (($svr, $nick, undef, $user, $mask, undef, undef, undef, undef, undef)) = @_;
# Check if it's for us.
if ($nick eq $Proto::IRC::botinfo{$svr}{nick}) {
# It is. Set data.
$Proto::IRC::botinfo{$svr}{user} = $user;
$Proto::IRC::botinfo{$svr}{mask} = $mask;
}
return 1;
});
sub clear_usercmd_timer
{
# If ratelimit is set to 1 in config, add this timer.