From: Brian S. Stephan Date: Fri, 23 Jan 2009 01:39:04 +0000 (-0600) Subject: hilight the $meta{account} in a tweet with the irssi hilight_color. needs a hacky... X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/commitdiff_plain/d7a849845c4bf66a97c4a535e1c7a2323cb28864?ds=inline;hp=-c hilight the $meta{account} in a tweet with the irssi hilight_color. needs a hacky irssi -> mirc lookup table :( --- d7a849845c4bf66a97c4a535e1c7a2323cb28864 diff --git a/twirssi.pl b/twirssi.pl index a1b4bcf..8f6be25 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -34,6 +34,24 @@ my %friends; my $last_poll = time - 300; my %tweet_cache; my %id_map; +my %irssi_to_mirc_colors = ( + '%k' => '01', + '%r' => '05', + '%g' => '03', + '%y' => '07', + '%b' => '02', + '%m' => '06', + '%c' => '10', + '%w' => '15', + '%K' => '14', + '%R' => '04', + '%G' => '09', + '%Y' => '08', + '%B' => '12', + '%M' => '13', + '%C' => '11', + '%W' => '00', +); sub cmd_direct { my ( $data, $server, $win ) = @_; @@ -734,7 +752,8 @@ sub monitor_child { $marker = ":$marker"; } - if ( $_ =~ /\@$meta{account}\W/ ) { + my $hilight_color = $irssi_to_mirc_colors{Irssi::settings_get_str("hilight_color")}; + if ( $_ =~ s/\@($meta{account})\W/\cC$hilight_color\@$1\cO/g ) { $hilight = MSGLEVEL_HILIGHT; }