X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/5716c1e0ce7cd0149f01d3755e9fc52a45d8c484..9a4113a1cd7cddfba5877f630297778a58287264:/twirssi.pl?ds=inline diff --git a/twirssi.pl b/twirssi.pl index af37616..7b02346 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -12,7 +12,7 @@ $Data::Dumper::Indent = 1; use vars qw($VERSION %IRSSI); $VERSION = "1.7.2"; -my ($REV) = '$Rev: 348 $' =~ /(\d+)/; +my ($REV) = '$Rev: 350 $' =~ /(\d+)/; %IRSSI = ( authors => 'Dan Boger', contact => 'zigdon@gmail.com', @@ -21,7 +21,7 @@ my ($REV) = '$Rev: 348 $' =~ /(\d+)/; . 'Can optionally set your bitlbee /away message to same', license => 'GNU GPL v2', url => 'http://tinyurl.com/twirssi', - changed => '$Date: 2009-01-06 11:09:34 -0800 (Tue, 06 Jan 2009) $', + changed => '$Date: 2009-01-06 14:59:49 -0800 (Tue, 06 Jan 2009) $', ); my $window; @@ -767,8 +767,9 @@ sub monitor_child { last if /^__friends__/; my %meta; foreach my $key (qw/id account nick type/) { - s/^$key:(\S+)\s*//; - $meta{$key} = $1; + if (s/^$key:(\S+)\s*//) { + $meta{$key} = $1; + } } next if exists $meta{id} and exists $tweet_cache{ $meta{id} }; @@ -875,8 +876,12 @@ sub notice { sub sig_complete { my ( $complist, $window, $word, $linestart, $want_space ) = @_; - # /twitter_reply gets a nick:num - if ( $linestart =~ /^\/twitter_reply(?:_as)?\s*$/ ) { + if ( + $linestart =~ /^\/twitter_reply(?:_as)?\s*$/ + or ( Irssi::settings_get_bool("twirssi_use_reply_aliases") + and $linestart =~ /^\/reply(?:_as)?\s*$/ ) + ) + { # /twitter_reply gets a nick:num @$complist = grep /^\Q$word/i, sort keys %{ $id_map{__indexes} }; } @@ -900,12 +905,13 @@ Irssi::settings_add_str( "twirssi", "twitter_usernames", undef ); Irssi::settings_add_str( "twirssi", "twitter_passwords", undef ); Irssi::settings_add_str( "twirssi", "twirssi_replies_store", ".irssi/scripts/twirssi.json" ); -Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 ); -Irssi::settings_add_bool( "twirssi", "show_reply_context", 0 ); -Irssi::settings_add_bool( "twirssi", "show_own_tweets", 1 ); -Irssi::settings_add_bool( "twirssi", "twirssi_debug", 0 ); -Irssi::settings_add_bool( "twirssi", "twirssi_first_run", 1 ); -Irssi::settings_add_bool( "twirssi", "twirssi_track_replies", 1 ); +Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 ); +Irssi::settings_add_bool( "twirssi", "show_reply_context", 0 ); +Irssi::settings_add_bool( "twirssi", "show_own_tweets", 1 ); +Irssi::settings_add_bool( "twirssi", "twirssi_debug", 0 ); +Irssi::settings_add_bool( "twirssi", "twirssi_first_run", 1 ); +Irssi::settings_add_bool( "twirssi", "twirssi_track_replies", 1 ); +Irssi::settings_add_bool( "twirssi", "twirssi_use_reply_aliases", 0 ); $window = Irssi::window_find_name( Irssi::settings_get_str('twitter_window') ); if ($window) { @@ -919,6 +925,10 @@ if ($window) { Irssi::command_bind( "twitter_logout", "cmd_logout" ); Irssi::command_bind( "twitter_switch", "cmd_switch" ); Irssi::command_bind( "twirssi_upgrade", "cmd_upgrade" ); + if ( Irssi::settings_get_bool("twirssi_use_reply_aliases") ) { + Irssi::command_bind( "reply", "cmd_reply" ); + Irssi::command_bind( "reply_as", "cmd_reply_as" ); + } Irssi::command_bind( "twirssi_dump", sub {