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.
This commit is contained in:
MarcelEdward 2014-09-03 16:43:39 +02:00
parent 95cab15864
commit e62834c197

View file

@ -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) {