X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/e12967f01425466111483936dc139aa2389cdc78..108f9ee00b45b3e0d85c06684d158675828c6364:/twirssi.pl diff --git a/twirssi.pl b/twirssi.pl index 9d88cad..c4b4e4b 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -10,8 +10,8 @@ $Data::Dumper::Indent = 1; use vars qw($VERSION %IRSSI); -$VERSION = "2.1.3beta"; -my ($REV) = '$Rev: 549 $' =~ /(\d+)/; +$VERSION = "2.2.1beta"; +my ($REV) = '$Rev: 569 $' =~ /(\d+)/; %IRSSI = ( authors => 'Dan Boger', contact => 'zigdon@gmail.com', @@ -20,7 +20,7 @@ my ($REV) = '$Rev: 549 $' =~ /(\d+)/; . 'Can optionally set your bitlbee /away message to same', license => 'GNU GPL v2', url => 'http://twirssi.com', - changed => '$Date: 2009-03-14 14:06:07 -0700 (Sat, 14 Mar 2009) $', + changed => '$Date: 2009-03-19 11:44:03 -0700 (Thu, 19 Mar 2009) $', ); my $window; @@ -747,15 +747,14 @@ sub do_updates { if ($context) { my $ctext = decode_entities( $context->{text} ); $ctext = &hilight($ctext); + if ( $context->{truncated} and ref($obj) ne 'Net::Identica' ) { + $ctext .= + " -- http://twitter.com/$context->{user}{screen_name}" + . "/status/$context->{id}"; + } printf $fh "id:%d account:%s nick:%s type:tweet %s\n", $context->{id}, $username, $context->{user}{screen_name}, $ctext; - if ( $context->{truncated} and ref($obj) ne 'Net::Identica' ) { - printf $fh "id:%s account:%s nick:%s type:ellispis %s\n", - $context->{id} . "-url", $username, - $context->{user}{screen_name}, -"http://twitter.com/$context->{user}{screen_name}/status/$context->{id}"; - } $reply = "reply"; } elsif ($@) { print $fh "type:debug request to get context failed: $@"; @@ -768,14 +767,12 @@ sub do_updates { next if $t->{user}{screen_name} eq $username and not Irssi::settings_get_bool("show_own_tweets"); - printf $fh "id:%d account:%s nick:%s type:%s %s\n", - $t->{id}, $username, $t->{user}{screen_name}, $reply, $text; if ( $t->{truncated} and ref($obj) ne 'Net::Identica' ) { - printf $fh "id:%s account:%s nick:%s type:ellispis %s\n", - $t->{id} . "-url", $username, - $t->{user}{screen_name}, - "http://twitter.com/$t->{user}{screen_name}/status/$t->{id}"; + $text .= " -- http://twitter.com/$t->{user}{screen_name}" + . "/status/$t->{id}"; } + printf $fh "id:%d account:%s nick:%s type:%s %s\n", + $t->{id}, $username, $t->{user}{screen_name}, $reply, $text; } print scalar localtime, " - Polling for replies" if &debug; @@ -795,14 +792,12 @@ sub do_updates { my $text = decode_entities( $t->{text} ); $text = &hilight($text); - printf $fh "id:%d account:%s nick:%s type:tweet %s\n", - $t->{id}, $username, $t->{user}{screen_name}, $text; if ( $t->{truncated} ) { - printf $fh "id:%s account:%s nick:%s type:ellispis %s\n", - $t->{id} . "-url", $username, - $t->{user}{screen_name}, - "http://twitter.com/$t->{user}{screen_name}/status/$t->{id}"; + $text .= " -- http://twitter.com/$t->{user}{screen_name}" + . "/status/$t->{id}"; } + printf $fh "id:%d account:%s nick:%s type:tweet %s\n", + $t->{id}, $username, $t->{user}{screen_name}, $text; } print scalar localtime, " - Polling for DMs" if &debug; @@ -938,8 +933,10 @@ sub monitor_child { my $hilight_color = $irssi_to_mirc_colors{ Irssi::settings_get_str("hilight_color") }; - if ( ( $_ =~ /\@$meta{account}\W/i ) - && Irssi::settings_get_bool("twirssi_hilights") ) + my $nick = + '@' . substr( $meta{account}, 0, index( $meta{account}, "@" ) ); + if ( $_ =~ /\Q$nick\E(?:\W|$)/i + and Irssi::settings_get_bool("twirssi_hilights") ) { $meta{nick} = "\cC$hilight_color$meta{nick}\cO"; $hilight = MSGLEVEL_HILIGHT; @@ -951,9 +948,6 @@ sub monitor_child { ( MSGLEVEL_PUBLIC | $hilight ), $meta{type}, $account, $meta{nick}, $marker, $_ ]; - } elsif ( $meta{type} eq 'ellispis' ) { - push @lines, - [ MSGLEVEL_PUBLIC, "tweet", $account, $meta{nick}, "", $_ ]; } elsif ( $meta{type} eq 'search' ) { push @lines, [ @@ -1272,7 +1266,9 @@ sub normalize_username { my $user = shift; my ( $username, $service ) = split /\@/, $user, 2; - unless ($service) { + if ($service) { + $service = ucfirst lc $service; + } else { $service = ucfirst lc Irssi::settings_get_str("twirssi_default_service"); unless ( exists $twits{"$username\@$service"} ) { @@ -1359,6 +1355,7 @@ if ($window) { Irssi::command_bind( "twitter_unsubscribe", "cmd_del_search" ); Irssi::command_bind( "twitter_list_subscriptions", "cmd_list_search" ); Irssi::command_bind( "twirssi_upgrade", "cmd_upgrade" ); + Irssi::command_bind( "twitter_updates", "get_updates" ); if ( Irssi::settings_get_bool("twirssi_use_reply_aliases") ) { Irssi::command_bind( "reply", "cmd_reply" ); Irssi::command_bind( "reply_as", "cmd_reply_as" ); @@ -1406,7 +1403,14 @@ if ($window) { sub { ¬ice("Stopped following $_[0]"); delete $nicks{ $_[0] }; } ) ); - Irssi::command_bind( "twitter_updates", "get_updates" ); + Irssi::command_bind( + "twitter_device_updates", + &gen_cmd( + "/twitter_device_updates none|im|sms", + "update_delivery_device", + sub { ¬ice("Device updated to $_[0]"); } + ) + ); Irssi::signal_add_last( 'complete word' => \&sig_complete ); ¬ice(" %Y<%C(%B^%C)%N TWIRSSI v%R$VERSION%N (r$REV)");