X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/f0c04189c57f0444094480a9602fd41a3d2606a1..89061e3ad9db4185d5589f91a05a0bad234f0a72:/twirssi.pl diff --git a/twirssi.pl b/twirssi.pl index c5384cf..5234372 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -543,7 +543,7 @@ sub cmd_login { unless ( $twit->authorized ) { ¬ice("Twirssi not autorized to access $service for $user."); ¬ice("Please authorize at the following url, then enter the pin "); - ¬ice("supplied with /twirssi_oath $user\@$service "); + ¬ice("supplied with /twirssi_oauth $user\@$service "); ¬ice($twit->get_authorization_url); $oauth{pending}{"$user\@$service"} = $twit; @@ -600,21 +600,21 @@ sub cmd_oauth { my $store_file = Irssi::settings_get_str("twirssi_oauth_store"); if ($store_file) { - my %store; + my @store; if ( open( OAUTH, $store_file ) ) { while () { chomp; - my ( $k, $v ) = split ' ', 2; - $store{$k} = $v; + next if /$key/i; + push @store, $_; } close OAUTH; } - $store{$key} = "$access_token $access_token_secret"; + push @store, "$key $access_token $access_token_secret"; if ( open( OAUTH, ">$store_file.new" ) ) { - print OAUTH "$_ $store{$_}\n" foreach keys %store; + print OAUTH "$_\n" foreach @store; close OAUTH; rename "$store_file.new", $store_file or ¬ice("Failed to rename $store_file.new: $!"); @@ -2002,9 +2002,7 @@ if ($window) { } } - if ( my $autouser = Irssi::settings_get_str("twitter_usernames") - and my $autopass = Irssi::settings_get_str("twitter_passwords") ) - { + if ( my $autouser = Irssi::settings_get_str("twitter_usernames") ) { &cmd_login(); &get_updates; }