mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
commit
4554a89754
3 changed files with 10 additions and 11 deletions
|
@ -3349,8 +3349,6 @@ void Application::updateLocationInServer() {
|
|||
|
||||
if (accountManager.isLoggedIn()) {
|
||||
|
||||
static QJsonObject lastLocationObject;
|
||||
|
||||
// construct a QJsonObject given the user's current address information
|
||||
QJsonObject updatedLocationObject;
|
||||
|
||||
|
@ -3361,14 +3359,9 @@ void Application::updateLocationInServer() {
|
|||
|
||||
updatedLocationObject.insert("address", addressObject);
|
||||
|
||||
if (updatedLocationObject != lastLocationObject) {
|
||||
|
||||
accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation,
|
||||
JSONCallbackParameters(), QJsonDocument(updatedLocationObject).toJson());
|
||||
|
||||
lastLocationObject = updatedLocationObject;
|
||||
}
|
||||
}
|
||||
accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation,
|
||||
JSONCallbackParameters(), QJsonDocument(updatedLocationObject).toJson());
|
||||
}
|
||||
}
|
||||
|
||||
void Application::domainChanged(const QString& domainHostname) {
|
||||
|
|
|
@ -1897,7 +1897,12 @@ void MyAvatar::resetSize() {
|
|||
|
||||
void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) {
|
||||
QJsonObject locationObject = jsonObject["data"].toObject()["address"].toObject();
|
||||
goToLocationFromAddress(locationObject);
|
||||
bool isOnline = jsonObject["data"].toObject()["online"].toBool();
|
||||
if (isOnline ) {
|
||||
goToLocationFromAddress(locationObject);
|
||||
} else {
|
||||
QMessageBox::warning(Application::getInstance()->getWindow(), "", "The user is not online.");
|
||||
}
|
||||
}
|
||||
|
||||
void MyAvatar::goToLocationFromAddress(const QJsonObject& locationObject) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# add the test directories
|
||||
file(GLOB TEST_SUBDIRS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
|
||||
list(REMOVE_ITEM TEST_SUBDIRS "CMakeFiles")
|
||||
foreach(DIR ${TEST_SUBDIRS})
|
||||
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
|
||||
add_subdirectory(${DIR})
|
||||
|
|
Loading…
Reference in a new issue