mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
deprecate the gender property from the protocol entirely (#4496)
* deprecate the gender property from the protocol entirely * use obsolete instead of deprecated * add the database migration * update internal database version as well
This commit is contained in:
parent
86881bbbc3
commit
07e6aadbbe
24 changed files with 25 additions and 170 deletions
|
|
@ -1164,7 +1164,6 @@ Response::ResponseCode AbstractServerSocketInterface::cmdRegisterAccount(const C
|
|||
}
|
||||
|
||||
QString realName = QString::fromStdString(cmd.real_name());
|
||||
ServerInfo_User_Gender gender = cmd.gender();
|
||||
QString country = QString::fromStdString(cmd.country());
|
||||
QString password = QString::fromStdString(cmd.password());
|
||||
|
||||
|
|
@ -1178,8 +1177,8 @@ Response::ResponseCode AbstractServerSocketInterface::cmdRegisterAccount(const C
|
|||
}
|
||||
|
||||
bool requireEmailActivation = settingsCache->value("registration/requireemailactivation", true).toBool();
|
||||
bool regSucceeded = sqlInterface->registerUser(userName, realName, gender, password, emailAddress, country,
|
||||
!requireEmailActivation);
|
||||
bool regSucceeded =
|
||||
sqlInterface->registerUser(userName, realName, password, emailAddress, country, !requireEmailActivation);
|
||||
|
||||
if (regSucceeded) {
|
||||
qDebug() << "Accepted register command for user: " << userName;
|
||||
|
|
@ -1260,16 +1259,14 @@ Response::ResponseCode AbstractServerSocketInterface::cmdAccountEdit(const Comma
|
|||
|
||||
QString realName = QString::fromStdString(cmd.real_name());
|
||||
QString emailAddress = QString::fromStdString(cmd.email());
|
||||
ServerInfo_User_Gender gender = cmd.gender();
|
||||
QString country = QString::fromStdString(cmd.country());
|
||||
|
||||
QString userName = QString::fromStdString(userInfo->name());
|
||||
|
||||
QSqlQuery *query = sqlInterface->prepareQuery("update {prefix}_users set realname=:realName, email=:email, "
|
||||
"gender=:gender, country=:country where name=:userName");
|
||||
"country=:country where name=:userName");
|
||||
query->bindValue(":realName", realName);
|
||||
query->bindValue(":email", emailAddress);
|
||||
query->bindValue(":gender", sqlInterface->getGenderChar(gender));
|
||||
query->bindValue(":country", country);
|
||||
query->bindValue(":userName", userName);
|
||||
if (!sqlInterface->execSqlQuery(query))
|
||||
|
|
@ -1277,7 +1274,6 @@ Response::ResponseCode AbstractServerSocketInterface::cmdAccountEdit(const Comma
|
|||
|
||||
userInfo->set_real_name(cmd.real_name());
|
||||
userInfo->set_email(cmd.email());
|
||||
userInfo->set_gender(cmd.gender());
|
||||
userInfo->set_country(cmd.country());
|
||||
|
||||
return Response::RespOk;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue