OSDN Git Service

imported http://mrmt.net/src/keitairc/keitairc r1.12
authormorimoto <morimoto@180c8125-5b33-4295-ad04-72a68a15b4cc>
Sun, 21 Mar 2004 11:04:01 +0000 (11:04 +0000)
committermorimoto <morimoto@180c8125-5b33-4295-ad04-72a68a15b4cc>
Sun, 21 Mar 2004 11:04:01 +0000 (11:04 +0000)
keitairc

index 93314ef..d155666 100755 (executable)
--- a/keitairc
+++ b/keitairc
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 # keitairc
-# $Id: keitairc,v 1.11 2004-03-21 11:03:51 morimoto Exp $
+# $Id: keitairc,v 1.12 2004-03-21 11:04:01 morimoto Exp $
 #
 # Copyright (c) 2003 Jun Morimoto <morimoto@xantia.citroen.org>
 # This program is covered by the GNU General Public License 2
@@ -8,7 +8,7 @@
 # Depends: libjcode-pm-perl, libpoe-component-irc-perl,
 #   liburi-perl, libwww-perl, libappconfig-perl
 
-my $rcsid = q$Id: keitairc,v 1.11 2004-03-21 11:03:51 morimoto Exp $;
+my $rcsid = q$Id: keitairc,v 1.12 2004-03-21 11:04:01 morimoto Exp $;
 my ($version) = $rcsid =~ m#,v ([0-9.]+)#;
 
 use strict;
@@ -102,11 +102,17 @@ sub on_irc_join{
 ################################################################
 sub on_irc_part{
     my ($kernel, $who, $channel) = @_[KERNEL, ARG0, ARG1];
+    $who =~ s/!.*//;
 
     # chop off after the gap (bug workaround of POE::Filter::IRC)
     $channel =~ s/ .*//;
 
-    delete $channel_name{$channel};
+    if ($who eq $config->irc_nick) {
+       delete $channel_name{$channel};
+    } else {
+       &add_message($channel, 'SYSOP', $who . ' leaves');
+    }
+    
 }
 
 ################################################################