Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void MsnNotificationConnection::gotUsr ( const QStringList &  command  )  [private]

Received a USR command from the server.

USR command for the login. At first we must send the handle with wich we want to log on. When the server response to first USR, we take the nonce value used for compute the return value. The key used for encrypt the data ( 3DES ) must be taken from Passport SOAP request. The computed value ( encryption of nonce with secret key taken by SOAP ) must be sended to server.

Definition at line 1339 of file msnnotificationconnection.cpp.

References createAddressBookService(), createPassportLoginService(), PassportLoginService::login(), AddressBookService::retrieveMembershipLists(), Account::saveTemporaryPassword(), and Account::setVerified().

Referenced by parseCommand().

{
  if(KMESS_NULL(currentAccount_)) return;

  const QString& step( command[2] );

  // This is either asking for authentication or confirming it
  if( step == "SSO" )
  {
    // The initial connection process (network connection establish and version exchange) is over.
    // The MSN servers sometimes fail to warn the clients that something's wrong by their side and
    // they close the connection before the USR. This is a nice workaround: if the connection gets
    // closed before this point, we just try again with HTTP, which usually works.
    isInitiatingConnection_ = false;

    const QString& policy ( command[4] ); // Policy
    nonceBase64_          = command[5];   // Base64 nonce

    // Change statusbar
    emit statusMessage( i18n("Authenticating..."), false );

    // Start the passport based login
    passportLoginService_ = createPassportLoginService();
    passportLoginService_->login( policy );
  }
  else if( step == "OK" )
  {
    // This is a confirmation message.  Get the user's friendly name from the message.
    bool isVerified = ( command[4].toInt() == 1 );
    currentAccount_->setVerified( isVerified );

#ifdef KMESSDEBUG_NOTIFICATION_GENERAL
    if( ! isVerified )
    {
      kWarning() << "Passport account of the user is not verified yet.";
    }
#endif

    // When users choose an existing account in the InitialView dialog,
    // they may alter the password. This value is stored as temporary password.
    // The password may be overwritten now, because the login was succesful.
    currentAccount_->saveTemporaryPassword();

    emit statusMessage( i18n( "Authenticated" ), false );

    // Retrieve from with one SOAP request the membership list ( where there are the lists for
    // FL AL BL contacts )
    AddressBookService *addressBook = createAddressBookService();
    addressBook->retrieveMembershipLists();
  }
  else
  {
    kWarning() << "Received unexpected USR step:" << step;
  }
}


Generated by  Doxygen 1.6.0   Back to index