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:
ebbit1q 2021-12-14 07:51:57 +01:00 committed by GitHub
parent 86881bbbc3
commit 07e6aadbbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 25 additions and 170 deletions

View file

@ -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;