From 7067cf2ab3e68665124db15e93a9436c98586b96 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 26 Feb 2014 13:40:49 -0800 Subject: [PATCH] fix go to user and address update for new API --- interface/src/Application.cpp | 4 ++-- interface/src/Menu.cpp | 2 +- interface/src/avatar/MyAvatar.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2fb91a8ef1..e8a7d0dcbc 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3367,9 +3367,9 @@ void Application::connectedToDomain(const QString& hostname) { if (accountManager.isLoggedIn()) { // update our domain-server with the data-server we're logged in with - QString domainPutJsonString = "{\"location\":{\"domain\":\"" + hostname + "\"}}"; + QString domainPutJsonString = "{\"address\":{\"domain\":\"" + hostname + "\"}}"; - accountManager.authenticatedRequest("/api/v1/users/location", QNetworkAccessManager::PutOperation, + accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation, JSONCallbackParameters(), domainPutJsonString.toUtf8()); } } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 89bebefcdd..e333aee2e4 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -999,7 +999,7 @@ void Menu::goTo() { callbackParams.jsonCallbackMethod = "goToLocationFromResponse"; // there's a username entered by the user, make a request to the data-server for the associated location - AccountManager::getInstance().authenticatedRequest("/api/v1/users/" + gotoDialog.textValue() + "/location", + AccountManager::getInstance().authenticatedRequest("/api/v1/users/" + gotoDialog.textValue() + "/address", QNetworkAccessManager::GetOperation, callbackParams); } diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 7b22201bfb..96e2cc2221 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1139,10 +1139,10 @@ void MyAvatar::updateLocationInDataServer() { QString orientationString(createByteArray(safeEulerAngles(getOrientation()))); // construct the json to put the user's location - QString locationPutJson = QString() + "{\"location\":{\"position\":\"" + QString locationPutJson = QString() + "{\"address\":{\"position\":\"" + positionString + "\", \"orientation\":\"" + orientationString + "\"}}"; - accountManager.authenticatedRequest("/api/v1/users/location", QNetworkAccessManager::PutOperation, + accountManager.authenticatedRequest("/api/v1/users/address", QNetworkAccessManager::PutOperation, JSONCallbackParameters(), locationPutJson.toUtf8()); } } @@ -1154,7 +1154,7 @@ void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) { // send a node kill request, indicating to other clients that they should play the "disappeared" effect sendKillAvatar(); - QJsonObject locationObject = jsonObject["data"].toObject()["location"].toObject(); + QJsonObject locationObject = jsonObject["data"].toObject()["address"].toObject(); QString positionString = locationObject["position"].toString(); QString orientationString = locationObject["orientation"].toString(); QString domainHostnameString = locationObject["domain"].toString();