X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/blobdiff_plain/e3f196ec3b0278acf9601baeae997ab8218e7926..932c6ef78a41b4e2d08a86ddd3347a9e468c574d:/twirssi.pl diff --git a/twirssi.pl b/twirssi.pl index a52823f..1adc317 100644 --- a/twirssi.pl +++ b/twirssi.pl @@ -499,6 +499,15 @@ sub cmd_login { ssl => Irssi::settings_get_bool("twirssi_avoid_ssl") ? 0 : 1, ); + unless ($twit) { + ¬ice("Failed to create Net::$service object! Aborting."); + return; + } + + if ( my $timeout = Irssi::settings_get_int("twitter_timeout") and $twit->can('ua')) { + $twit->ua->timeout($timeout); + } + unless ( $twit->verify_credentials() ) { ¬ice("Login as $user\@$service failed"); $twit = undef; @@ -1511,6 +1520,7 @@ Irssi::settings_add_str( "twirssi", "twirssi_replies_store", ".irssi/scripts/twirssi.json" ); Irssi::settings_add_int( "twirssi", "twitter_friends_poll", 600 ); +Irssi::settings_add_int( "twirssi", "twitter_timeout", 30 ); Irssi::settings_add_bool( "twirssi", "twirssi_upgrade_beta", 0 ); Irssi::settings_add_bool( "twirssi", "tweet_to_away", 0 );