diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index d5d99f31..3d1a0e27 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -578,6 +578,14 @@ void accountChangePassword(LoginData *loginData) loginData->newPassword); } +void accountChangeEmail(LoginData *loginData) +{ + Net::registerHandler(&loginHandler); + + Net::AccountServer::Account::changeEmail(loginData->username, + loginData->newEmail); +} + void switchCharacter(std::string* passToken) { Net::registerHandler(&logoutHandler); @@ -1000,6 +1008,21 @@ int main(int argc, char *argv[]) break; + case STATE_CHANGEEMAIL_ATTEMPT: + logger->log("State: CHANGE EMAIL ATTEMPT"); + accountChangeEmail(&loginData); + break; + + case STATE_CHANGEEMAIL: + logger->log("State: CHANGE EMAIL"); + currentDialog = new OkDialog("Email Address change", + "Email Address changed successfully!"); + currentDialog->addActionListener(&accountListener); + currentDialog = NULL; // OkDialog deletes itself + loginData.email = loginData.newEmail; + loginData.newEmail = ""; + break; + case STATE_CHANGEPASSWORD_ATTEMPT: logger->log("State: CHANGE PASSWORD ATTEMPT"); accountChangePassword(&loginData); |