From 95cab15864229a7a29db42876f8b9fd69b0751e8 Mon Sep 17 00:00:00 2001 From: MarcelEdward Date: Wed, 3 Sep 2014 16:34:23 +0200 Subject: [PATCH 1/3] the command: cmake . -GXcode creates a CMakeFiles direcory in the test directory, causing the creation of the xcode files to fail with an the source directory does not contain a CMakeList.txt file. This patch updates the CMakeList.txt file in the test directory to ignore that created dir. --- tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index dd2e6e396e..862792d8ac 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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}) From e62834c197d7705f8e1112ba647939834be063e5 Mon Sep 17 00:00:00 2001 From: MarcelEdward Date: Wed, 3 Sep 2014 16:43:39 +0200 Subject: [PATCH 2/3] This patch updates Application::updateLocationInServer() in Application.cpp The online status is updated when the position is send to the data web, a avatar gets an offline status if the data web did not get an update in the last 30 seconds. This function had an LastLocationObject in which only send in the location info to the data web in case the location changed. Removed the last location so the position of the avatar is send to the data web every 5 seconds, so that the online status remains online if the avatar is still online and does not switch to offline when the avatar does not move. --- interface/src/Application.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 10ae4b0303..9017867399 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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) { From 9662dced09102a978dec67967a5ad8b994463a7e Mon Sep 17 00:00:00 2001 From: MarcelEdward Date: Wed, 3 Sep 2014 16:59:00 +0200 Subject: [PATCH 3/3] This patch updates the MyAvatar.cpp file. It adds a check MyAvatar::goToLocationFromResponse to see if the user is online, if the teleport to the avatar is done and if not a message is shown which said that the user is not online --- interface/src/avatar/MyAvatar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index e51390f9d0..5f1b81fb14 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -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) {