# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/12keyword
# Keyword処理

# The line number (1 incremented) and filename below must be
# actual. see perlsyn.
# line 10 "keitairc/lib/plugins/99keyword"

use Encode;

$plugin = {
	name => 'keyword',

	message_replace_regexp => '(.*)',
	message_replace_imprementation => sub {
		my ($request, $session_id, $message) = @_;
		if(defined $::cf->irc_keyword()){
			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 $message;
	},
};

1;
