- if ( @user != @pass ) {
- ¬ice("Number of usernames doesn't match "
- . "the number of passwords - auto-login failed" );
- } else {
- my ( $u, $p );
- while ( @user and @pass ) {
- $u = shift @user;
- $p = shift @pass;
- &cmd_login_twitter("$u $p");
- }
- return;
- }
- } else {
- ¬ice("/twitter_login requires either a username and password "
- . "or twitter_usernames_twitter and twitter_passwords_twitter to be set." );
- return;
- }
-
- %friends = %nicks = ();
-
- $twit = Net::Twitter->new(
- username => $user,
- password => $pass,
- source => "twirssi"
- );
-
- unless ( $twit->verify_credentials() ) {
- ¬ice("Login as $user failed");
- $twit = undef;
- if ( keys %twits ) {
- &cmd_switch( ( keys %twits )[0], $server, $win );
- }
- return;
- }
-
- if ($twit) {
- my $rate_limit = $twit->rate_limit_status();
- if ( $rate_limit and $rate_limit->{remaining_hits} < 1 ) {
- ¬ice(
- "Rate limit exceeded, try again after $rate_limit->{reset_time}"
- );
- $twit = undef;
- return;
- }
-
- $twits{$user} = $twit;
- Irssi::timeout_remove($poll) if $poll;
- $poll = Irssi::timeout_add( &get_poll_time * 1000, \&get_updates, "" );
- ¬ice("Logged in as $user, loading friends list...");
- &load_friends();
- ¬ice( "loaded friends: ", scalar keys %friends );
- if ( Irssi::settings_get_bool("twirssi_first_run") ) {
- Irssi::settings_set_bool( "twirssi_first_run", 0 );
- unless ( exists $friends{twirssi} ) {
- ¬ice("Welcome to twirssi!"
- . " Perhaps you should add \@twirssi to your friends list,"
- . " so you can be notified when a new version is release?"
- . " Just type /twitter_friend twirssi." );
+
+ # if a password ends with a '\', it was meant to escape the comma, and
+ # it should be concatinated with the next one
+ my @unescaped;
+ while (@pass) {
+ my $p = shift @pass;
+ while ($p =~ /\\$/ and @pass) {
+ $p .= ",". shift @pass;