]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHooks.pl
fix unsetting autojoin when trying to join invite-only channel
[infobot.git] / src / IRC / IrcHooks.pl
index 249667a9632abce20103e54d3fb5e7b917c4784f..bcb6fcabe9146d4da5f50e0cae074ebc49b667fd 100644 (file)
@@ -170,12 +170,9 @@ sub on_connected {
 
     if ( scalar keys %users < 2 ) {
         &status( '!' x 40 );
-        &status(
-"!!! Ok.  Now type '/msg $ident PASS <pass>' to get master access through DCC CHAT."
-        );
+        &status("!!! Ok.  Now type '/msg $ident PASS <pass>' to get master access through DCC CHAT.");
         &status( '!' x 40 );
     }
-
     # end of first time run.
 
     if ( &IsChanConf('Wingate') > 0 ) {
@@ -213,12 +210,10 @@ sub on_connected {
     # Q, as on quakenet.org.
     if ( &IsParam('Q_pass') ) {
         &status('Authing to Q...');
-        &rawout(
-"PRIVMSG Q\@CServe.quakenet.org :AUTH $param{'Q_user'} $param{'Q_pass'}"
-        );
+        &rawout("PRIVMSG Q\@CServe.quakenet.org :AUTH $param{'Q_user'} $param{'Q_pass'}");
     }
 
-    &status('End of motd. Now lets join some channels...');
+    &status("$ident End of motd. Now lets join some channels...");
 
     #&joinNextChan();
 }
@@ -468,8 +463,10 @@ sub on_endofnames {
 
     &chanServCheck($chan);
 
+    # FIXME: scheduler is b0rken! flood join for now
     # schedule used to solve ircu (OPN) 'target too fast' problems.
-    $conn->schedule( 5, sub { &joinNextChan(); } );
+    #$conn->schedule( 5, sub { &joinNextChan(); } );
+    &joinNextChan();
 }
 
 sub on_init {
@@ -625,7 +622,8 @@ sub on_join {
     ### ROOTWARN:
     &rootWarn( $who, $user, $host, $chan )
       if ( &IsChanConf('RootWarn') > 0
-        && $user =~ /^~?r(oo|ew|00)t$/i );
+        && $user eq 'root' );
+        #&& $user =~ /^~?r(oo|ew|00)t$/i );
 
     ### emit a message based on who just joined
     &onjoin( $who, $user, $host, $chan ) if ( &IsChanConf('OnJoin') > 0 );
@@ -1092,7 +1090,7 @@ sub on_quit {
     # revert to main nick. Note that Net::IRC only knows our main nick
     if ( $nick eq $conn->nick() ) {
         &status("nickchange: own nick \"$nick\" became free; changing.");
-        &nick($mynick);
+        &nick($nick);
     }
 }
 
@@ -1332,8 +1330,8 @@ sub on_chanfull {
     my ($event) = @_;
     my @args = $event->args;
 
-    &status(">>> chanfull/$b_blue$args[1]$ob");
-
+    &status(">>> chanfull/$b_blue$args[1]$ob, removing autojoin");
+    delete $chanconf{$chan}{autojoin};
     &joinNextChan();
 }
 
@@ -1341,9 +1339,10 @@ sub on_inviteonly {
     $conn = shift(@_);
     my ($event) = @_;
     my @args = $event->args;
+    my $chan = $args[1];
 
-    &status(">>> inviteonly/$b_cyan$args[1]$ob");
-
+    &status(">>> inviteonly/$b_cyan$chan$ob, removing autojoin");
+    delete $chanconf{$chan}{autojoin};
     &joinNextChan();
 }