Ticket #21: no-nickname-change-error.patch

File no-nickname-change-error.patch, 1.6 kB (added by amroth, 14 months ago)
  • kmess/settings/accountswidget.cpp

     
    276276  QString   imageName     = 0; 
    277277  QString   tempImageName = 0; 
    278278  QString   initialStatus; 
     279  QString   newFriendlyName; 
    279280  QDir      imageFolder; 
    280281  bool      showImage; 
    281282  bool      success; 
     
    292293    } 
    293294  } 
    294295 
     296  // If the account is not verified, don't change the nickname. 
     297  if( ! account->isVerified() ) 
     298  { 
     299    newFriendlyName = account->getFriendlyName(); 
     300  } 
     301  else 
     302  { 
     303    newFriendlyName = friendlyNameEdit_->text(); 
     304  } 
     305 
    295306  // Update the settings 
    296   account->setLoginInformation( handleEdit_->text(), friendlyNameEdit_->text(), passwordEdit_->password() ); 
     307  account->setLoginInformation( handleEdit_->text(), newFriendlyName, passwordEdit_->password() ); 
    297308  account->setUseAutologin( autologinCheckBox_->isChecked() ); 
    298309  account->setShowImage( showImage ); 
    299310 
  • kmess/account.cpp

     
    11921192  ||  ( ! password.isEmpty() && password != password_ ) ) 
    11931193  { 
    11941194    handle_       = handle.lower(); 
    1195     friendlyName_ = friendlyName; 
    1196     emit changedFriendlyName(); 
    11971195 
     1196    // Never change the nickname if the account is not verified. We would receive a server error 
     1197    if( verified_ ) 
     1198    { 
     1199      friendlyName_ = friendlyName; 
     1200      emit changedFriendlyName(); 
     1201    } 
     1202 
    11981203    if( ! password.isEmpty() ) 
    11991204    { 
    12001205      password_ = password;