History

Fix small bugs with the HTTP request to screenshare endpoint

Zach Fox committed 7 years ago

Commit 61f08961 parent 8aea0dd1 file · +4 −6Browse files

Showing the changes to interface/src/scripting/ScreenshareScriptingInterface.cpp (1 of 1 file). Show all

Unified · Split

interface/src/scripting/ScreenshareScriptingInterface.cpp+4−6
@@ -93,18 +93,16 @@ void ScreenshareScriptingInterface::startScreenshare(const QUuid& screenshareZon · 92 unmodified lines
93 }93 }
94 94
95 QString currentDomainID = uuidStringWithoutCurlyBraces(addressManager->getDomainID());95 QString currentDomainID = uuidStringWithoutCurlyBraces(addressManager->getDomainID());
96 QString requestURLPath = "api/v1/domains";96 QString requestURLPath = "api/v1/domains/%1/screenshare";
97 requestURLPath = requestURLPath.append(currentDomainID);
98 requestURLPath = requestURLPath.append("/screenshare");
99 97
100 JSONCallbackParameters callbackParams;98 JSONCallbackParameters callbackParams;
101 callbackParams.callbackReceiver = this;99 callbackParams.callbackReceiver = this;
102 callbackParams.jsonCallbackMethod = "handleSuccessfulScreenshareInfoGet";100 callbackParams.jsonCallbackMethod = "handleSuccessfulScreenshareInfoGet";
103 callbackParams.errorCallbackMethod = "handleFailedScreenshareInfoGet";101 callbackParams.errorCallbackMethod = "handleFailedScreenshareInfoGet";
104 accountManager->sendRequest(102 accountManager->sendRequest(
105 requestURLPath,103 requestURLPath.arg(currentDomainID),
106 AccountManagerAuth::Required,104 AccountManagerAuth::Required,
107 QNetworkAccessManager::PutOperation,105 QNetworkAccessManager::GetOperation,
108 callbackParams106 callbackParams
109 );107 );
110}108}
@@ -200,7 +198,7 @@ void ScreenshareScriptingInterface::handleSuccessfulScreenshareInfoGet(QNetworkR · 89 unmodified lines
200}198}
201 199
202void ScreenshareScriptingInterface::handleFailedScreenshareInfoGet(QNetworkReply* reply) {200void ScreenshareScriptingInterface::handleFailedScreenshareInfoGet(QNetworkReply* reply) {
203 qDebug() << "\n\n MN HERE: handleFailedScreenshareInfoGet():" << reply->errorString();201 qDebug() << "\n\n MN HERE: handleFailedScreenshareInfoGet():" << reply->readAll();
204}202}
205 203
206void ScreenshareScriptingInterface::onWebEventReceived(const QUuid& entityID, const QVariant& message) {204void ScreenshareScriptingInterface::onWebEventReceived(const QUuid& entityID, const QVariant& message) {