[SimBot-commits] CVS: simbot/plugins services.chanserv.pl,1.11,1.12
Status: Abandoned
Brought to you by:
kstange
|
From: Kevin S. <ks...@us...> - 2005-07-26 02:12:26
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32752/plugins Modified Files: services.chanserv.pl Log Message: Better, but definitely not perfect Index: services.chanserv.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/services.chanserv.pl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -p -r1.11 -r1.12 --- services.chanserv.pl 26 Jul 2005 01:44:05 -0000 1.11 +++ services.chanserv.pl 26 Jul 2005 02:12:17 -0000 1.12 @@ -48,6 +48,17 @@ sub services_login { } } +sub registration_check { + my ($kernel, undef, undef, $newnick) = @_; + my $want = &SimBot::option('global', 'nickname'); + my $me = $SimBot::chosen_nick; + + if ($me eq $newnick && $me eq $want) { + &SimBot::debug(3, "Checking nickname availability...\n"); + $kernel->post(bot => sl => "nickserv info"); + } +} + # CHECK_RESPONSE: When we try to log in or run a command, services will tell us # something. Here, we handle different possible cases. sub check_response { @@ -182,9 +193,10 @@ sub process_notify { if ($me eq $want) { # Just check registration. Nickserv will let us know whether # we need to log in. - # XXX: This should be delayed. - $kernel->post(bot => sl => "nickserv info"); + # XXX: This should probably be delayed. + ®istration_check($kernel, undef, undef, $me); } else { + &SimBot::debug(3, "Desired nickname is in use; trying ghost...\n"); $kernel->post(bot => sl => "nickserv ghost $want $pass"); } } @@ -226,6 +238,7 @@ sub ban_user { event_channel_nojoin => \&request_unban, event_channel_mejoin => \&process_join, event_channel_novoice => \&request_voice, + event_server_nick => \®istration_check, list_nicks_ison => "NickServ", ); |