--- trunk/irc-logger.pl 2006/06/16 20:55:19 29 +++ trunk/irc-logger.pl 2006/06/16 21:28:46 30 @@ -44,7 +44,7 @@ use POE qw(Component::IRC Wheel::FollowTail Component::Server::HTTP); use HTTP::Status; use DBI; -use Encode qw/from_to/; +use Encode qw/from_to is_utf8/; use Regexp::Common qw /URI/; use CGI::Simple; use HTML::TagCloud; @@ -290,6 +290,8 @@ print "$channel: <$nick> $msg\n"; $sth->execute($channel, 0, $nick, $msg); + add_tag( id => $dbh->last_insert_id(undef,undef,"log",undef), + message => $msg); }, irc_ctcp_action => sub { my $kernel = $_[KERNEL]; @@ -301,6 +303,8 @@ print "$channel ***$nick $msg\n"; $sth->execute($channel, 1, $nick, $msg); + add_tag( id => $dbh->last_insert_id(undef,undef,"log",undef), + message => $msg); }, irc_msg => sub { my $kernel = $_[KERNEL]; @@ -494,7 +498,10 @@ return unless ($arg->{id} && $arg->{message}); - while ($arg->{message} =~ s#\b(\S+)//##s) { + my $m = $arg->{message}; + from_to('UTF-8', 'iso-8859-2', $m) if (is_utf8($m)); + + while ($m =~ s#\b([\w-_]+)//##s) { my $tag = $1; next if (! $tag || $tag =~ m/https?:/i); push @{ $tags->{$tag} }, $arg->{id};