summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/Services/yandex_service.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CloudFile/src/Services/yandex_service.cpp')
-rw-r--r--plugins/CloudFile/src/Services/yandex_service.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp
index 03f34a432e..d7b2e8b9e6 100644
--- a/plugins/CloudFile/src/Services/yandex_service.cpp
+++ b/plugins/CloudFile/src/Services/yandex_service.cpp
@@ -149,11 +149,17 @@ void CYandexService::CreateFolder(const char *path)
void CYandexService::CreateSharedLink(const char *path, char *url)
{
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
- YandexAPI::PublishRequest request(token, path);
- NLHR_PTR response(request.Send(hConnection));
+ YandexAPI::PublishRequest publishRequest(token, path);
+ NLHR_PTR response(publishRequest.Send(hConnection));
+
+ GetJsonResponse(response);
+
+ YandexAPI::GetResourcesRequest resourcesRequest(token, path);
+ response = resourcesRequest.Send(hConnection);
JSONNode root = GetJsonResponse(response);
- JSONNode link = root.at("href");
+ JSONNode link = root.at("public_url");
+
mir_strcpy(url, link.as_string().c_str());
}