]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHooks.pl
* Add vim formatting comments ( # vim:ts=4:sw=4:expandtab:tw=80 )
[infobot.git] / src / IRC / IrcHooks.pl
index ceb655bf0fb707194cb215390f9731c9c7c02900..07adbb2cd6b06afa93fb4a31232ff5b5b8c7f275 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 {
@@ -23,15 +24,13 @@ sub on_generic {
 sub on_action {
     $conn = shift(@_);
     my ($event) = @_;
-    my ($nick, @args) = ($event->nick, $event->args);
+    my ($nick, $args) = ($event->nick, $event->args);
     my $chan = ($event->to)[0];
 
-    shift @args;
-
     if ($chan eq $ident) {
-       &status("* [$nick] @args");
+       &status("* [$nick] $args");
     } else {
-       &status("* $nick/$chan @args");
+       &status("* $nick/$chan $args");
     }
 }
 
@@ -49,7 +48,7 @@ sub on_chat {
     }
 
     ### set vars that would have been set in hookMsg.
-    $userHandle                = "";   # reset.
+    $userHandle                = '';   # reset.
     $who               = lc $nick;
     $message           = $msg;
     $orig{who}         = $nick;
@@ -65,7 +64,7 @@ sub on_chat {
        my $crypto      = $users{$userHandle}{PASS};
        my $success     = 0;
 
-       if ($userHandle eq "_default") {
+       if ($userHandle eq '_default') {
            &WARN("DCC CHAT: _default/guest not allowed.");
            return;
        }
@@ -83,7 +82,7 @@ sub on_chat {
            $conn->privmsg($sock, "Commands start with '.' (like '.quit' or '.help')");
            $conn->privmsg($sock, "Everything else goes out to the party line.");
 
-           &dccStatus(2) unless (exists $sched{"dccStatus"}{RUNNING});
+           &dccStatus(2) unless (exists $sched{'dccStatus'}{RUNNING});
 
            $success++;
 
@@ -102,7 +101,7 @@ sub on_chat {
 
            $dcc{'CHATvrfy'}{$nick} = $userHandle;
 
-           return if ($userHandle eq "_default");
+           return if ($userHandle eq '_default');
 
            &dccsay($nick,"Flags: $users{$userHandle}{FLAGS}");
        }
@@ -114,9 +113,9 @@ sub on_chat {
 
     if ($message =~ s/^\.//) { # dcc chat commands.
        ### TODO: make use of &Forker(); here?
-       &loadMyModule( $myModules{'ircdcc'} );
+       &loadMyModule('UserDCC');
 
-       &DCCBroadcast("#$who# $message","m");
+       &DCCBroadcast("#$who# $message",'m');
 
        my $retval      = &userDCC();
        return unless (defined $retval);
@@ -159,7 +158,7 @@ sub on_endofmotd {
     # first time run.
     if (!exists $users{_default}) {
        &status("!!! First time run... adding _default user.");
-       $users{_default}{FLAGS} = "mrt";
+       $users{_default}{FLAGS} = 'amrt';
        $users{_default}{HOSTS}{"*!*@*"} = 1;
     }
 
@@ -170,7 +169,7 @@ sub on_endofmotd {
     }
     # end of first time run.
 
-    if (&IsChanConf("wingate")) {
+    if (&IsChanConf('Wingate') > 0) {
        my $file = "$bot_base_dir/$param{'ircUser'}.wingate";
        open(IN, $file);
        while (<IN>) {
@@ -182,11 +181,11 @@ sub on_endofmotd {
     }
 
     if ($firsttime) {
-       &ScheduleThis(1, \&setupSchedulers);
+       &ScheduleThis(1, 'setupSchedulers');
        $firsttime = 0;
     }
 
-    if (&IsParam("ircUMode")) {
+    if (&IsParam('ircUMode')) {
        &VERB("Attempting change of user modes to $param{'ircUMode'}.", 2);
        if ($param{'ircUMode'} !~ /^[-+]/) {
            &WARN("ircUMode had no +- prefix; adding +");
@@ -196,12 +195,6 @@ sub on_endofmotd {
        &rawout("MODE $ident $param{'ircUMode'}");
     }
 
-    &status("End of motd. Now lets join some channels...");
-    if (!scalar @joinchan) {
-       &WARN("joinchan array is empty!");
-       @joinchan = &getJoinChans(1);
-    }
-
     # ok, we're free to do whatever we want now. go for it!
     $running = 1;
 
@@ -209,12 +202,13 @@ sub on_endofmotd {
     $conn->ison($conn->nick());
 
     # Q, as on quakenet.org.
-    if (&IsParam("Q_pass")) {
+    if (&IsParam('Q_pass')) {
        &status("Authing to Q...");
        &rawout("PRIVMSG Q\@CServe.quakenet.org :AUTH $param{'Q_user'} $param{'Q_pass'}");
     }
 
-    &joinNextChan();
+    &status("End of motd. Now lets join some channels...");
+    #&joinNextChan();
 }
 
 sub on_endofwho {
@@ -235,6 +229,8 @@ sub on_dcc {
     my $type = uc( ($event->args)[1] );
     my $nick = lc $event->nick();
 
+    &status("on_dcc type=$type nick=$nick sock=$sock");
+
     # pity Net::IRC doesn't store nuh. Here's a hack :)
     if (!exists $nuh{lc $nick}) {
        $conn->whois($nick);
@@ -245,12 +241,16 @@ sub on_dcc {
     if ($type eq 'SEND') {     # GET for us.
        # incoming DCC SEND. we're receiving a file.
        my $get = ($event->args)[2];
-       open(DCCGET,">$get");
-
-       $conn->new_get($event, \*DCCGET);
+       &status("DCC: not Initializing GET from $nick to '$param{tempDir}/$get'");
+       # FIXME: do we want to get anything?
+       return;
+       #open(DCCGET,">$param{tempDir}/$get");
+       #$conn->new_get($event, \*DCCGET);
 
     } elsif ($type eq 'GET') { # SEND for us?
-       &status("DCC: Initializing SEND for $nick.");
+       &status("DCC: not Initializing SEND for $nick.");
+       # FIXME: do we want to do anything?
+       return;
        $conn->new_send($event->args);
 
     } elsif ($type eq 'CHAT') {
@@ -278,7 +278,7 @@ sub on_dcc_close {
     if (exists $dcc{'SEND'}{$nick} and -f "$param{tempDir}/$nick.txt") {
        &status("${b_green}DCC SEND$ob close from $b_cyan$nick$ob");
 
-       &status("dcc_close: purging $nick.txt from Debian.pl");
+       &status("dcc_close: purging DCC send $nick.txt");
        unlink "$param{tempDir}/$nick.txt";
 
        delete $dcc{'SEND'}{$nick};
@@ -298,6 +298,8 @@ sub on_dcc_open {
     my $nick = lc $event->nick();
     my $sock = ($event->to)[0];
 
+    &status("on_dcc_open type=$type nick=$nick sock=$sock");
+
     $msgType = 'chat';
     $type ||= "???";
     ### BUG: who is set to bot's nick?
@@ -311,15 +313,15 @@ sub on_dcc_open {
        ### TODO: run ScheduleThis inside on_dcc_open_chat recursively
        ###     1,3,5,10 seconds then fail.
        if ($nuh{$nick} eq "GETTING-NOW") {
-           &ScheduleThis(3/60, "on_dcc_open_chat", $nick, $sock);
+           &ScheduleThis(3/60, 'on_dcc_open_chat', $nick, $sock);
        } else {
            on_dcc_open_chat(undef, $nick, $sock);
        }
 
     } elsif ($type eq 'SEND') {
-       &DEBUG("Starting DCC receive.");
+       &status("Starting DCC receive.");
        foreach ($event->args) {
-           &DEBUG("  => '$_'.");
+           &status("  => '$_'.");
        }
 
     } else {
@@ -342,7 +344,7 @@ sub on_dcc_open_chat {
     &verifyUser($nick, $nuh{lc $nick});
 
     if (!exists $users{$userHandle}{HOSTS}) {
-       &pSReply("you have no hosts defined in my user file; rejecting.");
+       &performStrictReply("you have no hosts defined in my user file; rejecting.");
        $sock->close();
        return;
     }
@@ -351,7 +353,7 @@ sub on_dcc_open_chat {
     $dcc{'CHAT'}{$nick} = $sock;
 
     # TODO: don't make DCC CHAT established in the first place.
-    if ($userHandle eq "_default") {
+    if ($userHandle eq '_default') {
        &dccsay($nick, "_default/guest not allowed");
        $sock->close();
        return;
@@ -361,7 +363,7 @@ sub on_dcc_open_chat {
        &status("DCC CHAT: going to use ".$nick."'s crypt.");
        &dccsay($nick,"Enter your password.");
     } else {
-#      &dccsay($nick,"Welcome to blootbot DCC CHAT interface, $userHandle.");
+#      &dccsay($nick,"Welcome to infobot DCC CHAT interface, $userHandle.");
     }
 }
 
@@ -370,8 +372,9 @@ sub on_disconnect {
     my ($event) = @_;
     my $from = $event->from();
     my $what = ($event->args)[0];
+    my $mynick=$conn->nick();
 
-    &status("disconnect from $from ($what).");
+    &status("$mynick disconnect from $from ($what).");
     $ircstats{'DisconnectTime'}                = time();
     $ircstats{'DisconnectReason'}      = $what;
     $ircstats{'DisconnectCount'}++;
@@ -390,12 +393,9 @@ sub on_disconnect {
        return;
     }
 
-    if (!$conn->connect()) {
-       &DEBUG("on_disconnect: 3");
-       &WARN("not connected? help me. gonna call ircCheck() in 60s");
-       &clearIRCVars();
-       &ScheduleThis(1, "ircCheck");
-    }
+    &WARN("scheduling call ircCheck() in 60s");
+    &clearIRCVars();
+    &ScheduleThis(1, 'ircCheck');
 }
 
 sub on_endofnames {
@@ -418,13 +418,13 @@ sub on_endofnames {
 
     my $txt;
     my @array;
-    foreach ("o","v","") {
+    foreach ('o','v','') {
        my $count = scalar(keys %{ $channels{$chan}{$_} });
        next unless ($count);
 
-       $txt = "total" if ($_ eq "");
-       $txt = "voice" if ($_ eq "v");
-       $txt = "ops"   if ($_ eq "o");
+       $txt = 'total' if ($_ eq '');
+       $txt = 'voice' if ($_ eq 'v');
+       $txt = 'ops'   if ($_ eq 'o');
 
        push(@array, "$count $txt");
     }
@@ -475,17 +475,17 @@ sub on_join {
     my ($user,$host)   = split(/\@/, $event->userhost);
     $chan              = lc( ($event->to)[0] ); # CASING!!!!
     $who               = $event->nick();
-    $msgType           = "public";
+    $msgType           = 'public';
     my $i              = scalar(keys %{ $channels{$chan} });
     my $j              = $cache{maxpeeps}{$chan} || 0;
 
-    if (!&IsParam("noSHM") && time() > ($sched{shmFlush}{TIME} || time()) + 3600) {
+    if (!&IsParam('noSHM') && time() > ($sched{shmFlush}{TIME} || time()) + 3600) {
        &DEBUG("looks like schedulers died somewhere... restarting...");
        &setupSchedulers();
     }
 
     $chanstats{$chan}{'Join'}++;
-    $userstats{lc $who}{'Join'} = time() if (&IsChanConf("seenStats") > 0);
+    $userstats{lc $who}{'Join'} = time() if (&IsChanConf('seenStats') > 0);
     $cache{maxpeeps}{$chan}    = $i if ($i > $j);
 
     &joinfloodCheck($who, $chan, $event->userhost);
@@ -516,7 +516,7 @@ sub on_join {
 
     # how to tell if there's a netjoin???
 
-    my $netsplitstr = "";
+    my $netsplitstr = '';
     $netsplitstr = " $b_yellow\[${ob}NETSPLIT VICTIM$b_yellow]$ob" if ($netsplit);
     &status(">>> join/$b_blue$chan$ob $b_cyan$who$ob $b_yellow($ob$user\@$host$b_yellow)$ob$netsplitstr");
 
@@ -527,7 +527,7 @@ sub on_join {
     ### on-join bans.
     my @bans;
     push(@bans, keys %{ $bans{$chan} }) if (exists $bans{$chan});
-    push(@bans, keys %{ $bans{"*"} })   if (exists $bans{"*"});
+    push(@bans, keys %{ $bans{'*'} })   if (exists $bans{'*'});
 
     foreach (@bans) {
        my $ban = $_;
@@ -542,7 +542,7 @@ sub on_join {
        }
 
        my $reason = "no reason";
-       foreach ($chan, "*") {
+       foreach ($chan, '*') {
            next unless (exists $bans{$_});
            next unless (exists $bans{$_}{$ban});
 
@@ -562,7 +562,7 @@ sub on_join {
     return if ($netsplit);
 
     # who == bot.
-    if ($who eq $ident or $who =~ /^\Q$ident\E$/i) {
+    if ($who =~ /^\Q$ident\E$/i) {
        if (defined( my $whojoin = $cache{join}{$chan} )) {
            &msg($chan, "Okay, I'm here. (courtesy of $whojoin)");
            delete $cache{join}{$chan};
@@ -578,21 +578,24 @@ sub on_join {
 
     ### ROOTWARN:
     &rootWarn($who,$user,$host,$chan) if (
-               &IsChanConf("rootWarn") &&
+               &IsChanConf('RootWarn') > 0 &&
                $user =~ /^~?r(oo|ew|00)t$/i
     );
 
+    ### emit a message based on who just joined
+        &onjoin($who,$user,$host,$chan) if (&IsChanConf('OnJoin') > 0);
+
     ### NEWS:
-    if (&IsChanConf("news") && &IsChanConf("newsKeepRead")) {
-       if (!&loadMyModule("news")) {   # just in case.
-           &DEBUG("could not load news.");
+    if (&IsChanConf('News') > 0 && &IsChanConf('newsKeepRead') > 0) {
+       if (!&loadMyModule('News')) {   # just in case.
+           &DEBUG('could not load news.');
        } else {
            &News::latest($chan);
        }
     }
 
     ### botmail:
-    if (&IsChanConf("botmail")) {
+    if (&IsChanConf('botmail') > 0) {
        &botmail::check(lc $who);
     }
 
@@ -632,7 +635,7 @@ sub on_mode {
     $chan      = ($event->to)[0];
 
     # last element is empty... so nuke it.
-    pop @args while ($args[$#args] eq "");
+    pop @args while ($args[$#args] eq '');
 
     if ($nick eq $chan) {      # UMODE
        &status(">>> mode $b_yellow\[$ob$b@args$b_yellow\]$ob by $b_cyan$nick$ob");
@@ -665,7 +668,7 @@ sub on_msg {
     $h         = $host;
 
     if ($nick eq $ident) { # hopefully ourselves.
-       if ($msg eq "TEST") {
+       if ($msg eq 'TEST') {
            &status("IRCTEST: Yes, we're alive.");
            delete $cache{connect};
            return;
@@ -673,9 +676,9 @@ sub on_msg {
     }
 
     &hookMsg('private', undef, $nick, $msg);
-    $who       = "";
-    $chan      = "";
-    $msgType   = "";
+    $who       = '';
+    $chan      = '';
+    $msgType   = '';
 }
 
 sub on_names {
@@ -717,9 +720,10 @@ sub on_nick {
     $nuh{lc $newnick} = $nuh{lc $nick};
     delete $nuh{lc $nick};
 
-    if ($nick eq $ident) {
+    if ($nick eq $conn->nick()) {
        &status(">>> I materialized into $b_green$newnick$ob from $nick");
-       $ident  = $newnick;
+       $ident = $newnick;
+       $conn->nick($newnick);
     } else {
        &status(">>> $b_cyan$nick$ob materializes into $b_green$newnick$ob");
        my $mynick=$conn->nick();
@@ -732,22 +736,18 @@ sub on_nick {
 sub on_nick_taken {
     $conn = shift(@_);
     my $nick   = $conn->nick();
-    my $newnick = $nick.int(rand 10);
+    #my $newnick = $nick . int(rand 10);
+    my $newnick = $nick . '_';
 
-    if ($nick eq $ident) {
-       &DEBUG("on_nick_tane: nick eq ident... wtf?");
-       return;
-    }
-
-    &DEBUG("on_nick_taken: ident => $ident");
+    &DEBUG("on_nick_taken: nick => $nick");
 
     &status("nick taken ($nick); preparing nick change.");
 
     $conn->whois($nick);
-    $conn->schedule(5, sub {
+    #$conn->schedule(5, sub {
        &status("nick taken; changing to temporary nick ($nick -> $newnick).");
        &nick($newnick);
-    } );
+    #} );
 }
 
 sub on_notice {
@@ -767,7 +767,7 @@ sub on_notice {
        if ($check) {
            &status("nickserv told us to register; doing it.");
 
-           if (&IsParam("nickServ_pass")) {
+           if (&IsParam('nickServ_pass')) {
                &status("NickServ: ==> Identifying.");
                &rawout("PRIVMSG NickServ :IDENTIFY $param{'nickServ_pass'}");
                return;
@@ -780,7 +780,7 @@ sub on_notice {
        if ($args =~ /^Password a/i) {
            my $done    = 0;
 
-           foreach ( &ChanConfList("chanServ_ops") ) {
+           foreach ( &ChanConfList('chanServ_ops') ) {
                next unless &chanServCheck($_);
                next if ($done);
                &DEBUG("nickserv activated or restarted; doing chanserv check.");
@@ -817,13 +817,14 @@ sub on_part {
     $conn = shift(@_);
     my ($event) = @_;
     $chan      = lc( ($event->to)[0] );        # CASING!!!
+    my $mynick = $conn->nick();
     my $nick   = $event->nick;
     my $userhost = $event->userhost;
     $who       = $nick;
-    $msgType   = "public";
+    $msgType   = 'public';
 
-    if (0 and !exists $channels{$chan}) {
-       &DEBUG("on_part: found out we're on $chan!");
+    if (!exists $channels{$chan}) {
+       &DEBUG("on_part: found out $mynick is on $chan!");
        $channels{$chan} = 1;
     }
 
@@ -837,7 +838,7 @@ sub on_part {
        &clearChanVars($chan);
     }
 
-    if (!&IsNickInAnyChan($nick) and &IsChanConf("seenStats") > 0) {
+    if (!&IsNickInAnyChan($nick) and &IsChanConf('seenStats') > 0) {
        delete $userstats{lc $nick};
     }
 
@@ -871,13 +872,13 @@ sub on_ping_reply {
 sub on_public {
     $conn = shift(@_);
     my ($event) = @_;
-    my $msg    = ($event->args)[0];
+    my $msg    = ($event->args)[0];
     $chan      = lc( ($event->to)[0] );        # CASING.
     my $nick   = $event->nick;
     $who       = $nick;
     $uh                = $event->userhost();
     $nuh       = $nick."!".$uh;
-    $msgType   = "public";
+    $msgType   = 'public';
     # TODO: move this out of hookMsg to here?
     ($user,$host) = split(/\@/, $uh);
     $h         = $host;
@@ -891,7 +892,7 @@ sub on_public {
     $msgtime           = time();
     $lastWho{$chan}    = $nick;
     ### TODO: use $nick or lc $nick?
-    if (&IsChanConf("seenStats") > 0) {
+    if (&IsChanConf('seenStats') > 0) {
        $userstats{lc $nick}{'Count'}++;
        $userstats{lc $nick}{'Time'} = time();
     }
@@ -900,7 +901,7 @@ sub on_public {
     my $time   = time();
     if (!$cache{ircTextCounters}) {
        &DEBUG("caching ircTextCounters for first time.");
-       my @str = split(/\s+/, &getChanConf("ircTextCounters"));
+       my @str = split(/\s+/, &getChanConf('ircTextCounters'));
        for (@str) { $_ = quotemeta($_); }
        $cache{ircTextCounters} = join('|', @str);
     }
@@ -910,11 +911,11 @@ sub on_public {
        my $x = $1;
 
        &VERB("textcounters: $x matched for $who",2);
-       my $c = $chan || "PRIVATE";
+       my $c = $chan || 'PRIVATE';
 
        # better to do "counter=counter+1".
        # but that will avoid time check.
-       my ($v,$t) = &sqlSelect("stats", "counter,time", {
+       my ($v,$t) = &sqlSelect('stats', "counter,time", {
                        nick    => $who,
                        type    => $x,
                        channel => $c,
@@ -922,9 +923,8 @@ sub on_public {
        $v++;
 
        # don't allow ppl to cheat the stats :-)
-       if (defined $t && $time - $t > 60) {
-           &sqlReplace("stats", {
-               nick    => $who,
+       if ((defined $t && $time - $t > 60) or (!defined $t)) {
+           &sqlSet('stats', {'nick' => $who}, {
                type    => $x,
                channel => $c,
                time    => $time,
@@ -935,9 +935,9 @@ sub on_public {
 
     &hookMsg('public', $chan, $nick, $msg);
     $chanstats{$chan}{'PublicMsg'}++;
-    $who       = "";
-    $chan      = "";
-    $msgType   = "";
+    $who       = '';
+    $chan      = '';
+    $msgType   = '';
 }
 
 sub on_quit {
@@ -947,7 +947,7 @@ sub on_quit {
     my $reason = ($event->args)[0];
 
     # hack for ICC.
-    $msgType   = "public";
+    $msgType   = 'public';
     $who       = $nick;
 ###    $chan   = $reason;      # no.
 
@@ -971,7 +971,7 @@ sub on_quit {
 
        # chanlimit code.
        foreach $chan ( &getNickInChans($nick) ) {
-           next unless ( &IsChanConf("chanlimitcheck") );
+           next unless ( &IsChanConf('chanlimitcheck') > 0);
            next unless ( exists $channels{$_}{'l'} );
 
            &DEBUG("on_quit: netsplit detected on $_; disabling chan limit.");
@@ -987,9 +987,6 @@ sub on_quit {
 
     my $chans = join(' ', &getNickInChans($nick) );
     &status(">>> $b_cyan$nick$ob has signed off IRC $b_red($ob$reason$b_red)$ob [$chans]");
-    if ($nick =~ /^\Q$ident\E$/) {
-       &ERROR("^^^ THIS SHOULD NEVER HAPPEN (10).");
-    }
 
     ###
     ### ok... lets clear out the cache
@@ -1001,14 +998,14 @@ sub on_quit {
        # well.. it's good but weird that this has happened - lets just
        # be quiet about it.
     }
-    delete $userstats{lc $nick} if (&IsChanConf("seenStats") > 0);
+    delete $userstats{lc $nick} if (&IsChanConf('seenStats') > 0);
     delete $chanstats{lc $nick};
     ###
 
-    # FIXME: does this work?
-    my $mynick = $conn->nick();
-    if ($nick !~ /^\Q$ident\E$/ and $nick =~ /^\Q$mynick\E$/i) {
-       &status("nickchange: own nickname became free; changing.");
+    # if we have a temp nick, and whoever is camping on our main nick leaves
+    # 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);
     }
 }
@@ -1070,7 +1067,7 @@ sub on_topic {
        &status(">>> topic/$b_blue$chan$ob by $b_cyan$nick$ob -> $topic");
     } else {                                           # join.
        my ($nick, $chan, $topic) = $event->args;
-       if (&IsChanConf("topic")) {
+       if (&IsChanConf('Topic') > 0) {
            $topic{$chan}{'Current'}    = $topic;
            &topicAddHistory($chan,$topic);
        }
@@ -1247,8 +1244,8 @@ sub on_banned {
     my @args   = $event->args;
     my $chan   = $args[1];
 
-    &status(">>> banned/$b_blue$chan$ob $b_cyan$args[0]$ob");
-
+    &status(">>> banned/$b_blue$chan$ob $b_cyan$args[0]$ob, removing autojoin for $chan");
+    delete $chanconf{$chan}{autojoin};
     &joinNextChan();
 }
 
@@ -1256,8 +1253,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();
 }
 
@@ -1270,4 +1269,13 @@ sub on_useronchan {
     &joinNextChan();
 }
 
+# TODO not used yet
+sub on_stdin {
+    my $line = <STDIN>;
+    chomp($line);
+    &FIXME("on_stdin: line => \"$line\"");
+}
+
 1;
+
+# vim:ts=4:sw=4:expandtab:tw=80