#!/usr/bin/perl
# keitairc
-# $Id: keitairc,v 1.20 2004-06-07 01:27:57 morimoto Exp $
+# $Id: keitairc,v 1.21 2004-07-24 08:54:51 morimoto Exp $
#
# Copyright (c) 2003 Jun Morimoto <morimoto@xantia.citroen.org>
# This program is covered by the GNU General Public License 2
# Depends: libjcode-pm-perl, libpoe-component-irc-perl,
# liburi-perl, libwww-perl, libappconfig-perl
-my $rcsid = q$Id: keitairc,v 1.20 2004-06-07 01:27:57 morimoto Exp $;
+my $rcsid = q$Id: keitairc,v 1.21 2004-07-24 08:54:51 morimoto Exp $;
my ($version) = $rcsid =~ m#,v ([0-9.]+)#;
use strict;
irc_part => \&on_irc_part,
irc_public => \&on_irc_public,
irc_notice => \&on_irc_notice,
+ irc_ctcp_action => \&on_irc_ctcp_action,
);
# web server component
}
################################################################
+sub on_irc_ctcp_action{
+ my ($kernel, $who, $channel, $msg) = @_[KERNEL, ARG0 .. ARG2];
+ $who =~ s/!.*//;
+ $channel = $channel->[0];
+ $msg = sprintf('* %s %s', $who, Jcode->new($msg, 'jis')->euc);
+ &add_message($channel, '', $msg);
+}
+
+################################################################
# $msg \e$B$O\e(B EUC \e$B$K$J$C$F$$$k$O$:\e(B
# $channel \e$B$O\e(B jis \e$B$G$-$F$k$>\e(B
sub add_message{
################################################################
sub escape{
local($_) = shift;
- s/&/&/;
- s/>/>/;
- s/</</;
+ s/&/&/g;
+ s/>/>/g;
+ s/</</g;
$_;
}