]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/Irc.pl
no more pSReply
[infobot.git] / src / IRC / Irc.pl
index d359f303fe3a02e93baa4b5588a17317cccdcdb7..6a419674f428ea4ac32cd60c431180cb562a06dd 100644 (file)
@@ -6,7 +6,9 @@
 #
 
 use strict;
+
 no strict 'refs';
+no strict 'subs'; # IN/STDIN
 
 use vars qw(%floodjoin %nuh %dcc %cache %conns %channels %param %mask
        %chanconf %orig %ircPort %ircstats %last %netsplit);
@@ -17,6 +19,9 @@ use vars qw($notcount $nottime $notsize $msgcount $msgtime $msgsize
 use vars qw($b_blue $ob);
 use vars qw(@ircServers);
 
+#use open ':utf8';
+#use open ':std';
+
 $nickserv      = 0;
 my $maxlinelen = 400;
 
@@ -170,6 +175,12 @@ sub irc {
 
     $ircstats{'Server'}        = "$server:$port";
 
+    # works? needs to actually do something
+    # should likely listen on a tcp port instead
+    #$irc->addfh(STDIN, \&on_stdin, "r");
+
+    &status("starting main loop");
+
     $irc->start;
 }
 
@@ -388,10 +399,6 @@ sub performAddressedReply {
     &performReply(@_);
 }
 
-sub pSReply {
-    &performStrictReply(@_);
-}
-
 # Usage: &performStrictReply($reply);
 sub performStrictReply {
     my ($reply) = @_;
@@ -445,8 +452,9 @@ sub dcc_close {
 }
 
 sub joinchan {
-    my ($chan) = @_;
-    my $key    = &getChanConf("chankey", $chan) || "";
+    my ($chan, $key) = @_;
+    $key ||= &getChanConf("chankey", $chan);
+    $key ||= "";
 
     # forgot for about 2 years to implement channel keys when moving
     # over to Net::IRC...
@@ -456,10 +464,10 @@ sub joinchan {
        &status("join: already on $chan?");
     }
     #} else {
-       &status("joining $b_blue$chan$ob");
+       &status("joining $b_blue$chan $key$ob");
 
        return if ($conn->join($chan, $key));
-       return if (&validChan($chan));
+       return if (&validChan($chan));
 
        &DEBUG("joinchan: join failed. trying connect!");
        &clearIRCVars();