# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/12keyword
# Keyword処理
-# $Id: 99keyword,v 1.1 2008-06-30 15:29:32 morimoto Exp $
+# $Id: 99keyword,v 1.2 2008-12-29 11:20:42 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/99keyword,v $
# The line number (1 incremented) and filename below must be
# actual. see perlsyn.
-# line 10 "keitairc/lib/plugins/12keyword"
+# line 10 "keitairc/lib/plugins/99keyword"
+
+use Encode;
$plugin = {
name => 'keyword',
- message_replace_regexp => '(\d\d:\d\d) (.*>) (.*)',
+ message_replace_regexp => '(.*)',
message_replace_imprementation => sub {
- my ($session_id, $time, $nick, $message) = @_;
+ my ($session_id, $message) = @_;
if(defined $::cf->irc_keyword()){
- for my $keyword (split(',', $::cf->irc_keyword())){
- $message =~ s|$keyword|<b>$keyword</b>|g;
+ my $keywords = $::cf->irc_keyword();
+ Encode::_utf8_on($keywords);
+ for my $keyword (split(',', $keywords)){
+ $message =~ s|$keyword|<font color="#0000ff"><b>$keyword</b></font>|g;
}
}
- return sprintf('%s %s %s', $time, $nick, $message);
+ return $message;
},
};