Skip to content

Commit 39c4a33

Browse files
author
Dan Boger
committed
1.7.8 - r435 - Pull patch from bss to use message formats and have proper hilights.
1 parent ee0c503 commit 39c4a33

1 file changed

Lines changed: 51 additions & 33 deletions

File tree

twirssi.pl

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
use vars qw($VERSION %IRSSI);
1313

14-
$VERSION = "1.7.7";
15-
my ($REV) = '$Rev: 422 $' =~ /(\d+)/;
14+
$VERSION = "1.7.8";
15+
my ($REV) = '$Rev: 435 $' =~ /(\d+)/;
1616
%IRSSI = (
1717
authors => 'Dan Boger',
1818
contact => 'zigdon@gmail.com',
@@ -21,7 +21,7 @@
2121
. 'Can optionally set your bitlbee /away message to same',
2222
license => 'GNU GPL v2',
2323
url => 'http://tinyurl.com/twirssi',
24-
changed => '$Date: 2009-01-26 08:19:42 -0800 (Mon, 26 Jan 2009) $',
24+
changed => '$Date: 2009-01-27 16:40:26 -0800 (Tue, 27 Jan 2009) $',
2525
);
2626

2727
my $window;
@@ -35,22 +35,22 @@
3535
my %tweet_cache;
3636
my %id_map;
3737
my %irssi_to_mirc_colors = (
38-
'%k' => '01',
39-
'%r' => '05',
40-
'%g' => '03',
41-
'%y' => '07',
42-
'%b' => '02',
43-
'%m' => '06',
44-
'%c' => '10',
45-
'%w' => '15',
46-
'%K' => '14',
47-
'%R' => '04',
48-
'%G' => '09',
49-
'%Y' => '08',
50-
'%B' => '12',
51-
'%M' => '13',
52-
'%C' => '11',
53-
'%W' => '00',
38+
'%k' => '01',
39+
'%r' => '05',
40+
'%g' => '03',
41+
'%y' => '07',
42+
'%b' => '02',
43+
'%m' => '06',
44+
'%c' => '10',
45+
'%w' => '15',
46+
'%K' => '14',
47+
'%R' => '04',
48+
'%G' => '09',
49+
'%Y' => '08',
50+
'%B' => '12',
51+
'%M' => '13',
52+
'%C' => '11',
53+
'%W' => '00',
5454
);
5555

5656
sub cmd_direct {
@@ -752,20 +752,33 @@ sub monitor_child {
752752
$marker = ":$marker";
753753
}
754754

755-
my $hilight_color = $irssi_to_mirc_colors{Irssi::settings_get_str("hilight_color")};
755+
my $hilight_color =
756+
$irssi_to_mirc_colors{ Irssi::settings_get_str("hilight_color") };
756757
if ( $_ =~ /\@($meta{account})\W/ ) {
757758
$meta{nick} = "\cC$hilight_color$meta{nick}\cO";
758759
$hilight = MSGLEVEL_HILIGHT;
759760
}
760761

761762
if ( $meta{type} eq 'tweet' ) {
762-
push @lines, [(MSGLEVEL_PUBLIC | $hilight), $meta{type}, $account, $meta{nick}, $marker, $_];
763+
push @lines,
764+
[
765+
( MSGLEVEL_PUBLIC | $hilight ),
766+
$meta{type}, $account, $meta{nick}, $marker, $_
767+
];
763768
} elsif ( $meta{type} eq 'reply' ) {
764-
push @lines, [(MSGLEVEL_PUBLIC | $hilight), $meta{type}, $account, $meta{nick}, $marker, $_];
769+
push @lines,
770+
[
771+
( MSGLEVEL_PUBLIC | $hilight ),
772+
$meta{type}, $account, $meta{nick}, $marker, $_
773+
];
765774
} elsif ( $meta{type} eq 'dm' ) {
766-
push @lines, [(MSGLEVEL_MSGS | $hilight), $meta{type}, $account, $meta{nick}, $_];
775+
push @lines,
776+
[
777+
( MSGLEVEL_MSGS | $hilight ),
778+
$meta{type}, $account, $meta{nick}, $_
779+
];
767780
} elsif ( $meta{type} eq 'error' ) {
768-
push @lines, [MSGLEVEL_MSGS, $_];
781+
push @lines, [ MSGLEVEL_MSGS, $_ ];
769782
} elsif ( $meta{type} eq 'debug' ) {
770783
print "$_" if &debug,;
771784
} else {
@@ -785,9 +798,12 @@ sub monitor_child {
785798

786799
if ($new_last_poll) {
787800
print "new last_poll = $new_last_poll" if &debug;
788-
for my $line ( @lines ) {
789-
$window->printformat(@$line[0], "twirssi_".@$line[1],
790-
@$line[2,3,4,5]);
801+
for my $line (@lines) {
802+
$window->printformat(
803+
@$line[0],
804+
"twirssi_" . @$line[1],
805+
@$line[ 2, 3, 4, 5 ]
806+
);
791807
}
792808

793809
close FILE;
@@ -933,12 +949,14 @@ sub event_send_text {
933949

934950
Irssi::signal_add( "send text", "event_send_text" );
935951

936-
Irssi::theme_register([
937-
'twirssi_tweet', '[$0%B@$1%n$2] $3',
938-
'twirssi_reply', '[$0\--> %B@$1%n$2] $3',
939-
'twirssi_dm', '[$0%B@$1%n (%WDM%n)] $2',
940-
'twirssi_error', 'ERROR: $0',
941-
]);
952+
Irssi::theme_register(
953+
[
954+
'twirssi_tweet', '[$0%B@$1%n$2] $3',
955+
'twirssi_reply', '[$0\--> %B@$1%n$2] $3',
956+
'twirssi_dm', '[$0%B@$1%n (%WDM%n)] $2',
957+
'twirssi_error', 'ERROR: $0',
958+
]
959+
);
942960

943961
Irssi::settings_add_str( "twirssi", "twitter_window", "twitter" );
944962
Irssi::settings_add_str( "twirssi", "bitlbee_server", "bitlbee" );

0 commit comments

Comments
 (0)