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