]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHooks.pl
root[wW]arn -> RootWarn
[infobot.git] / src / IRC / IrcHooks.pl
index 8c989eb884df30bcfde32376fb0d25c287afe378..3ed802c0f63f906d2f3636ef4e77b93686e1ced7 100644 (file)
@@ -4,6 +4,7 @@
 #     Version: 20000126
 #        NOTE: Based on code by Kevin Lenzo & Patrick Cole  (c) 1997
 #
+use vars qw(%chanconf);
 
 # GENERIC. TO COPY.
 sub on_generic {
@@ -114,7 +115,7 @@ sub on_chat {
 
     if ($message =~ s/^\.//) { # dcc chat commands.
        ### TODO: make use of &Forker(); here?
-       &loadMyModule( $myModules{'ircdcc'} );
+       &loadMyModule( $myModules{'UserDCC'} );
 
        &DCCBroadcast("#$who# $message","m");
 
@@ -571,7 +572,7 @@ sub on_join {
 
     ### ROOTWARN:
     &rootWarn($who,$user,$host,$chan) if (
-               &IsChanConf("rootWarn") &&
+               &IsChanConf('RootWarn') &&
                $user =~ /^~?r(oo|ew|00)t$/i
     );
 
@@ -1234,8 +1235,8 @@ sub on_banned {
     my @args   = $event->args;
     my $chan   = $args[1];
 
-    &status(">>> banned/$b_blue$chan$ob $b_cyan$args[0]$ob");
-    #FIXME if $args[0] == me then kill autojoin!
+    &status(">>> banned/$b_blue$chan$ob $b_cyan$args[0]$ob, removing autojoin for $chan");
+    delete $chanconf{$chan}{autojoin};
     &joinNextChan();
 }
 
@@ -1243,8 +1244,10 @@ sub on_badchankey {
     $conn = shift(@_);
     my ($event) = @_;
     my @args   = $event->args;
+    my $chan   = $args[1];
 
-    &DEBUG("on_badchankey: args => @args");
+    &DEBUG("on_badchankey: args => @args, removing autojoin for $chan");
+    delete $chanconf{$chan}{autojoin};
     &joinNextChan();
 }
 
@@ -1257,4 +1260,11 @@ sub on_useronchan {
     &joinNextChan();
 }
 
+# TODO not used yet
+sub on_stdin {
+    my $line = <STDIN>;
+    chomp($line);
+    &FIXME("on_stdin: line => \"$line\"");
+}
+
 1;