projects
/
twirssi-net-twitter-lite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f0c0418
)
Improve oauth with multiple accounts
author
Dan Boger
<zigdon@irc.peeron.com>
Tue, 12 Jan 2010 07:40:25 +0000
(23:40 -0800)
committer
Dan Boger
<zigdon@irc.peeron.com>
Tue, 12 Jan 2010 07:40:25 +0000
(23:40 -0800)
twirssi.pl
patch
|
blob
|
history
diff --git
a/twirssi.pl
b/twirssi.pl
index c5384cfccaaccd50c4edbd47f9bffaed170fdff1..3ae46d936ccf71e56dc42397fa68bb0969880107 100644
(file)
--- a/
twirssi.pl
+++ b/
twirssi.pl
@@
-600,21
+600,21
@@
sub cmd_oauth {
my $store_file = Irssi::settings_get_str("twirssi_oauth_store");
if ($store_file) {
my $store_file = Irssi::settings_get_str("twirssi_oauth_store");
if ($store_file) {
- my
%
store;
+ my
@
store;
if ( open( OAUTH, $store_file ) ) {
while (<OAUTH>) {
chomp;
if ( open( OAUTH, $store_file ) ) {
while (<OAUTH>) {
chomp;
-
my ( $k, $v ) = split ' ', 2
;
-
$store{$k} = $v
;
+
next if /$key/i
;
+
push @store, $_
;
}
close OAUTH;
}
}
close OAUTH;
}
-
$store{$key} = "
$access_token $access_token_secret";
+
push @store, "$key
$access_token $access_token_secret";
if ( open( OAUTH, ">$store_file.new" ) ) {
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: $!");
close OAUTH;
rename "$store_file.new", $store_file
or ¬ice("Failed to rename $store_file.new: $!");