summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2008-04-25 23:15:03 +0000
committerYohann Ferreira <bertram@cegetel.net>2008-04-25 23:15:03 +0000
commit536f18bdaae32831aa92702535586f26d0628a42 (patch)
treef438efa69af7a6588bd00df126cd1f7c07bb8641 /src/main.cpp
parent23e6d031b6c9f20dea6ba48dd1826d3286e18233 (diff)
downloadmana-client-536f18bdaae32831aa92702535586f26d0628a42.tar.gz
mana-client-536f18bdaae32831aa92702535586f26d0628a42.tar.bz2
mana-client-536f18bdaae32831aa92702535586f26d0628a42.tar.xz
mana-client-536f18bdaae32831aa92702535586f26d0628a42.zip
Added client-side email address change ability.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
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);