OSDN Git Service

Add option to disable/enable "join/leave" message.
authormatusita <matusita@180c8125-5b33-4295-ad04-72a68a15b4cc>
Fri, 2 May 2008 14:49:23 +0000 (14:49 +0000)
committermatusita <matusita@180c8125-5b33-4295-ad04-72a68a15b4cc>
Fri, 2 May 2008 14:49:23 +0000 (14:49 +0000)
ChangeLog
etc/dot.keitairc
lib/Keitairc/Config.pm
lib/Keitairc/IrcCallback.pm

index b8144d2..5d816f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
        (thanks to Takahashi Yoshihiro)\e$B!%\e(B Closes #11019.
        * keitairc, etc/dot.keitairc, lib/Keitairc/Config.pm: daemonize\e$B$7\e(B
        \e$B$?8e$N\e(Bpid\e$B%U%!%$%kL>$rJQ99$9$k%*%W%7%g%s$rDI2C!%\e(B Closes #12449.
+       * etc/dot.keitairc, lib/Keitairc/Config.pm,
+       lib/Keitairc/IrcCallback.pm: \e$B%A%c%s%M%k$KBP$9$k\e(Bjoin/leave\e$B%a%C%;!<\e(B
+       \e$B%8$rI=<($7$J$$$?$a$N%*%W%7%g%s$rDI2C!%\e(B Closes #11021.
        
 2008-03-15  Jun Morimoto  <morimoto@mrmt.net>
 
index 402d3e9..6f5ca7f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # sample ~/.keitairc for keitairc 2.x
 #
-# $Id: dot.keitairc,v 1.8 2008-05-02 14:40:27 matusita Exp $
+# $Id: dot.keitairc,v 1.9 2008-05-02 14:49:23 matusita Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/etc/dot.keitairc,v $
 
 ################################################################
@@ -82,6 +82,10 @@ web_password = 1234
 #reverse_recent = 0
 #reverse_unread = 0
 
+# By default, join/leave messages are shown to channel page.
+# Set to this value to '0' to disable.
+# show_joinleave = 0
+
 # Set to 1 if you wanna daemonize keitairc.
 # daemonize = 1
 
index 4aacdc5..35d5e44 100644 (file)
@@ -1,6 +1,6 @@
 # -*-perl-*-
 # Keitairc::Config
-# $Id: Config.pm,v 1.9 2008-05-02 14:40:27 matusita Exp $
+# $Id: Config.pm,v 1.10 2008-05-02 14:49:23 matusita Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/Config.pm,v $
 #
 # Copyright (c) 2008 Jun Morimoto <morimoto@mrmt.net>
@@ -31,7 +31,7 @@ sub new{
                   use_cookie cookie_ttl session_ttl
                   web_port web_title web_lines web_root
                   web_username web_password web_host
-                  show_newmsgonly ping_delay reconnect_delay
+                  show_newmsgonly show_joinleave ping_delay reconnect_delay
                   smtp_server smtp_from smtp_to debug
                   template_dir version daemonize pid_dir pid_file plugin_dir
                   reverse_message reverse_recent reverse_unread)
@@ -56,6 +56,7 @@ sub new{
        $me->reverse_message(1);
        $me->reverse_recent(1);
        $me->reverse_unread(1);
+       $me->show_joinleave(1);
 
        if(defined $argv[0]){
                unless(-e $argv[0]){
index e871005..22b3e65 100644 (file)
@@ -1,6 +1,6 @@
 # -*-perl-*-
 # Keitairc::IrcCallback
-# $Id: IrcCallback.pm,v 1.6 2008-05-02 14:01:06 matusita Exp $
+# $Id: IrcCallback.pm,v 1.7 2008-05-02 14:49:23 matusita Exp $
 # $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/IrcCallback.pm,v $
 #
 # Copyright (c) 2008 Jun Morimoto <morimoto@mrmt.net>
@@ -57,7 +57,7 @@ sub irc_join{
        $ib->join($channel);
        if($who ne $cf->irc_nick()){
                my $cid = $ib->name2cid($channel);
-               $ib->add_message($cid, "$who joined");
+               $ib->add_message($cid, "$who joined") if ($cf->show_joinleave());
        }
 
        $heap->{Irc}->yield(who => $channel);
@@ -79,7 +79,7 @@ sub irc_part{
        if($who eq $cf->irc_nick()){
                $ib->part($cid);
        } else {
-               $ib->add_message($cid, "$who leaves");
+               $ib->add_message($cid, "$who leaves") if ($cf->show_joinleave());
        }
        $ib->remove_nick($cid, $who);
        $heap->{seen_traffic} = 1;