X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/4d57961e9e959e8b069c54a6ae333ddd3e97bd4e..1acdbe928017001985960d17ff477f9e9f16d3d0:/twirssi.pl diff --git a/twirssi.pl b/twirssi.pl index 0ee8ab1..2e73470 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -11,8 +11,8 @@ $Data::Dumper::Indent = 1; use vars qw($VERSION %IRSSI); -$VERSION = "2.1.1beta"; -my ($REV) = '$Rev: 491 $' =~ /(\d+)/; +$VERSION = "2.1.2beta"; +my ($REV) = '$Rev: 499 $' =~ /(\d+)/; %IRSSI = ( authors => 'Dan Boger', contact => 'zigdon@gmail.com', @@ -21,7 +21,7 @@ my ($REV) = '$Rev: 491 $' =~ /(\d+)/; . 'Can optionally set your bitlbee /away message to same', license => 'GNU GPL v2', url => 'http://twirssi.com', - changed => '$Date: 2009-02-25 10:44:26 -0800 (Wed, 25 Feb 2009) $', + changed => '$Date: 2009-03-02 12:51:50 -0800 (Mon, 02 Mar 2009) $', ); my $window; @@ -546,7 +546,7 @@ sub cmd_upgrade { ¬ice("Downloading twirssi from $URL"); LWP::Simple::getstore( $URL, "$loc.upgrade" ); - unless ($data) { + unless ( $data or Irssi::settings_get_bool("twirssi_upgrade_beta") ) { unless ( open( NEW, "$loc.upgrade" ) ) { ¬ice( "Failed to read $loc.upgrade. Check that /set twirssi_location is set to the correct location." @@ -868,6 +868,10 @@ sub monitor_child { } if ( not $meta{type} or $meta{type} ne 'searchid' ) { + if ( exists $meta{id} and exists $new_cache{ $meta{id} } ) { + next; + } + $new_cache{ $meta{id} } = time; if ( exists $meta{id} and exists $tweet_cache{ $meta{id} } ) { @@ -998,7 +1002,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; @@ -1037,11 +1041,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"); } } @@ -1053,6 +1057,10 @@ sub notice { $window->print( "%R***%n @_", MSGLEVEL_PUBLIC ); } +sub ccrap { + $window->print( "%R***%n @_", MSGLEVEL_CLIENTCRAP ); +} + sub update_away { my $data = shift; @@ -1066,7 +1074,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; } @@ -1211,6 +1219,10 @@ Irssi::settings_add_bool( "twirssi", "tweet_window_input", 0 ); $last_poll = time - &get_poll_time; $window = Irssi::window_find_name( Irssi::settings_get_str('twitter_window') ); if ( !$window ) { + Irssi::active_win() + ->print( "Couldn't find a window named '" + . Irssi::settings_get_str('twitter_window') + . "', trying to create it." ); $window = Irssi::Windowitem::window_create( Irssi::settings_get_str('twitter_window'), 1 );