<p class="flushleft">
morimoto@xantia.citroen.org<br>
-$Id: index.html,v 1.26 2004-09-15 09:47:36 morimoto Exp $
+$Id: index.html,v 1.27 2004-09-16 13:44:10 morimoto Exp $
</p>
<hr>
¤Þ¤¿¡¢Ì¤ÆÉÆâÍƤΤ¢¤ë¥Á¥ã¥Í¥ë¤¬¤Ò¤È¤Ä¤Ç¤â¤¢¤ë¾ì¹ç¤Ï¡¢
¥Á¥ã¥Í¥ë¤Î¥ê¥¹¥È¤Ë recent ¥ê¥ó¥¯¤¬¤Ä¤¤Þ¤¹¡£
recent ¥ê¥ó¥¯¤Ï¡¢Ã¼Ëö¤Ë¤è¤Ã¤Æ¤Ï * ¥¡¼¤ò²¡¤¹¤À¤±¤Ç¤â¹Ô¤¯¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
-recent ¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢Á´¥Á¥ã¥Í¥ë¤Î̤Æɤò¤Þ¤È¤áÆɤߤǤ¤Þ¤¹¡£
+recent ¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢Á´¥Á¥ã¥Í¥ë¤Î̤Æɤò¤Þ¤È¤áÆɤߤǤ¤Þ¤¹¡£<br>
+¥Á¥ã¥Í¥ë¤Î¥ê¥¹¥È¤Î topics ¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¡¢Á´¥Á¥ã¥Í¥ë¤Î¥È¥Ô¥Ã¥¯¤ò°ìÍ÷¤Ç¤¤Þ¤¹¡£
+topics ¥ê¥ó¥¯¤Ï¡¢Ã¼Ëö¤Ë¤è¤Ã¤Æ¤Ï * ¥¡¼¤ò²¡¤¹¤À¤±¤Ç¤â¹Ô¤¯¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
<p>
¥Á¥ã¥Í¥ë¤Îȯ¸ÀÆâÍƤòÆɤó¤Ç¤¤¤Æ¡¢
#!/usr/bin/perl
# keitairc
-# $Id: keitairc,v 1.28 2004-09-11 16:18:24 morimoto Exp $
+# $Id: keitairc,v 1.29 2004-09-16 13:44:10 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.28 2004-09-11 16:18:24 morimoto Exp $;
+my $rcsid = q$Id: keitairc,v 1.29 2004-09-16 13:44:10 morimoto Exp $;
my ($version) = $rcsid =~ m#,v ([0-9.]+)#;
use strict;
# join \e$B$7$F$$$k%A%c%M%k$NL>>N$r5-O?$9$k%O%C%7%e\e(B
my %channel_name;
+# join \e$B$7$F$$$k%A%c%M%k$NL>>N$r5-O?$9$k%O%C%7%e\e(B
+my %topic;
+
# \e$B%A%c%M%k$N2qOCFbMF$r5-O?$9$k%O%C%7%e\e(B
my (%channel_buffer, %channel_recent);
irc_part => \&on_irc_part,
irc_public => \&on_irc_public,
irc_notice => \&on_irc_notice,
+ irc_topic => \&on_irc_topic,
+ irc_332 => \&on_irc_topicraw,
irc_ctcp_action => \&on_irc_ctcp_action,
);
}
################################################################
+sub on_irc_topic{
+ my ($kernel, $who, $channel, $topic) = @_[KERNEL, ARG0 .. ARG2];
+ $who =~ s/!.*//;
+ $topic = Jcode->new($topic, 'jis')->euc;
+ &add_message($channel, undef, "$who set topic: $topic");
+ $topic{&canon_name($channel)} = $topic;
+}
+
+################################################################
+sub on_irc_topicraw{
+ my ($kernel, $raw) = @_[KERNEL, ARG1];
+ my ($channel, $topic) = split(/ :/, $raw, 2);
+ $topic{&canon_name($channel)} = $topic;
+}
+
+################################################################
sub on_irc_ctcp_action{
my ($kernel, $who, $channel, $msg) = @_[KERNEL, ARG0 .. ARG2];
$who =~ s/!.*//;
$buf .= qq(* <a href="$docroot,recent" accesskey="*">recent</a><br>);
}
+ if(keys %topic){
+ $buf .= qq(# <a href="$docroot,topics" accesskey="#">topics</a><br>);
+ }
+
$buf .= qq( - keitairc $version);
$buf;
}
}
}
$content .= qq(<a accesskey="8" href="$docroot">ch list[8]</a>);
+ }elsif($option{topics}){
+ # topic on every channel
+ for my $canon_channel (sort keys %channel_name){
+ my $channel = $channel_name{$canon_channel};
+ if(length $channel){
+ $content .= sprintf(' <a href="%s%s">%s</a><br>',
+ $docroot, uri_escape($channel),
+ Jcode->new($channel_name{$canon_channel})->euc);
+ $content .= &escape(Jcode->new($topic{$canon_channel})->euc);
+ $content .= '<br>';
+ }
+ }
+ $content .= qq(<br><a accesskey="8" href="$docroot">ch list[8]</a>);
}else{
# channel list
$content .= &index_page;
} else {
$content .= &render($channel_buffer{$canon_channel});
}
+ $content .= '<a accesskey="9" href="#2"></a>';
$content .= '<a name="2"></a>';
}else{
$content .= 'no message here yet';