X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/6d1d1ce87185116edd13415b9c40ef1d02c28311..f8ceb4b4ec4256d125e26563fb2396e1d118a6cd:/twirssi.pl?ds=inline diff --git a/twirssi.pl b/twirssi.pl index 23f9646..5783d33 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -12,7 +12,7 @@ $Data::Dumper::Indent = 1; use vars qw($VERSION %IRSSI); $VERSION = "2.1.2beta"; -my ($REV) = '$Rev: 497 $' =~ /(\d+)/; +my ($REV) = '$Rev: 520 $' =~ /(\d+)/; %IRSSI = ( authors => 'Dan Boger', contact => 'zigdon@gmail.com', @@ -21,7 +21,7 @@ my ($REV) = '$Rev: 497 $' =~ /(\d+)/; . 'Can optionally set your bitlbee /away message to same', license => 'GNU GPL v2', url => 'http://twirssi.com', - changed => '$Date: 2009-02-28 11:24:31 -0800 (Sat, 28 Feb 2009) $', + changed => '$Date: 2009-03-07 13:31:54 -0800 (Sat, 07 Mar 2009) $', ); my $window; @@ -737,6 +737,12 @@ sub do_updates { printf $fh "id:%d account:%s nick:%s type:tweet %s\n", $context->{id}, $username, $context->{user}{screen_name}, $ctext; + if ($context->{truncated}) { + printf $fh "id:%d 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: $@"; @@ -751,6 +757,12 @@ sub do_updates { 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}) { + printf $fh "id:%d 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}"; + } } print scalar localtime, " - Polling for replies" if &debug; @@ -772,6 +784,12 @@ sub do_updates { $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:%d 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}"; + } } print scalar localtime, " - Polling for DMs" if &debug; @@ -1002,7 +1020,7 @@ sub monitor_child { print JSON JSON::Any->objToJson( \%id_map ); close JSON; } else { - ¬ice("Failed to write replies to $file: $!"); + &ccrap("Failed to write replies to $file: $!"); } } $failwhale = 0; @@ -1041,11 +1059,11 @@ sub monitor_child { q{ '--/_.'----'`} ) { - ¬ice($whale); + &ccrap($whale); } $failwhale = 1; } - ¬ice("Haven't been able to get updated tweets since $since"); + &ccrap("Haven't been able to get updated tweets since $since"); } } @@ -1057,6 +1075,10 @@ sub notice { $window->print( "%R***%n @_", MSGLEVEL_PUBLIC ); } +sub ccrap { + $window->print( "%R***%n @_", MSGLEVEL_CLIENTCRAP ); +} + sub update_away { my $data = shift; @@ -1070,7 +1092,7 @@ sub update_away { $server->send_raw("away :$data"); return 1; } else { - ¬ice( "Can't find bitlbee server.", + &ccrap( "Can't find bitlbee server.", "Update bitlbee_server or disable tweet_to_away" ); return 0; } @@ -1123,8 +1145,10 @@ sub sig_complete { ) { # /twitter_reply gets a nick:num $word =~ s/^@//; - @$complist = map { "$_:$id_map{__indexes}{$_}" } grep /^\Q$word/i, - sort keys %{ $id_map{__indexes} }; + @$complist = map { "$_:$id_map{__indexes}{$_}" } + sort {$nicks{$b} <=> $nicks{$a}} + grep /^\Q$word/i, + keys %{ $id_map{__indexes} }; } # /tweet, /tweet_as, /dm, /dm_as - complete @nicks (and nicks as the first