From e62834c197d7705f8e1112ba647939834be063e5 Mon Sep 17 00:00:00 2001 From: MarcelEdward Date: Wed, 3 Sep 2014 16:43:39 +0200 Subject: [PATCH] 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) {