diff options
Diffstat (limited to 'plugins/CloudFile/src/Services/yandex_service.cpp')
-rw-r--r-- | plugins/CloudFile/src/Services/yandex_service.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index cf4c5786e0..176bcd21a6 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -46,7 +46,7 @@ void CYandexService::Login() ptrA refreshToken(db_get_sa(NULL, GetAccountName(), "RefreshToken")); if (token && refreshToken && refreshToken[0]) { YandexAPI::RefreshTokenRequest request(refreshToken); - NLHR_PTR response(request.Send(hConnection)); + NLHR_PTR response(request.Send(m_hConnection)); JSONNode root = GetJsonResponse(response); @@ -84,21 +84,21 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param) GetDlgItemTextA(hwndDlg, IDC_OAUTH_CODE, requestToken, _countof(requestToken)); YandexAPI::GetAccessTokenRequest request(requestToken); - NLHR_PTR response(request.Send(service->hConnection)); + NLHR_PTR response(request.Send(service->m_hConnection)); if (response == nullptr || response->resultCode != HTTP_CODE_OK) { const char *error = response->dataLength ? response->pData : service->HttpStatusToError(response->resultCode); - Netlib_Logf(service->hConnection, "%s: %s", service->GetAccountName(), error); + Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), error); //ShowNotification(TranslateT("server does not respond"), MB_ICONERROR); return 0; } JSONNode root = JSONNode::parse(response->pData); if (root.empty()) { - Netlib_Logf(service->hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError(response->resultCode)); + Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError(response->resultCode)); //ShowNotification(TranslateT("server does not respond"), MB_ICONERROR); return 0; } @@ -106,7 +106,7 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param) JSONNode node = root.at("error_description"); if (!node.isnull()) { ptrW error_description(mir_a2u_cp(node.as_string().c_str(), CP_UTF8)); - Netlib_Logf(service->hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError(response->resultCode)); + Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError(response->resultCode)); //ShowNotification((wchar_t*)error_description, MB_ICONERROR); return 0; } @@ -134,7 +134,7 @@ unsigned CYandexService::RevokeAccessTokenThread(void *param) ptrA token(db_get_sa(NULL, service->GetAccountName(), "TokenSecret")); YandexAPI::RevokeAccessTokenRequest request(token); - NLHR_PTR response(request.Send(service->hConnection)); + NLHR_PTR response(request.Send(service->m_hConnection)); return 0; } @@ -153,7 +153,7 @@ void CYandexService::CreateUploadSession(const char *path, char *uploadUri) ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret")); BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE); YandexAPI::GetUploadUrlRequest request(token, path, (OnConflict)strategy); - NLHR_PTR response(request.Send(hConnection)); + NLHR_PTR response(request.Send(m_hConnection)); JSONNode root = GetJsonResponse(response); JSONNode node = root.at("href"); @@ -163,7 +163,7 @@ void CYandexService::CreateUploadSession(const char *path, char *uploadUri) void CYandexService::UploadFile(const char *uploadUri, const char *data, size_t size) { YandexAPI::UploadFileRequest request(uploadUri, data, size); - NLHR_PTR response(request.Send(hConnection)); + NLHR_PTR response(request.Send(m_hConnection)); HandleHttpError(response); @@ -176,7 +176,7 @@ void CYandexService::UploadFile(const char *uploadUri, const char *data, size_t void CYandexService::UploadFileChunk(const char *uploadUri, const char *chunk, size_t chunkSize, uint64_t offset, uint64_t fileSize) { YandexAPI::UploadFileChunkRequest request(uploadUri, chunk, chunkSize, offset, fileSize); - NLHR_PTR response(request.Send(hConnection)); + NLHR_PTR response(request.Send(m_hConnection)); HandleHttpError(response); @@ -191,7 +191,7 @@ void CYandexService::CreateFolder(const char *path) { ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret")); YandexAPI::CreateFolderRequest request(token, path); - NLHR_PTR response(request.Send(hConnection)); + NLHR_PTR response(request.Send(m_hConnection)); GetJsonResponse(response); } @@ -200,12 +200,12 @@ void CYandexService::CreateSharedLink(const char *path, char *url) { ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret")); YandexAPI::PublishRequest publishRequest(token, path); - NLHR_PTR response(publishRequest.Send(hConnection)); + NLHR_PTR response(publishRequest.Send(m_hConnection)); GetJsonResponse(response); YandexAPI::GetResourcesRequest resourcesRequest(token, path); - response = resourcesRequest.Send(hConnection); + response = resourcesRequest.Send(m_hConnection); JSONNode root = GetJsonResponse(response); JSONNode link = root.at("public_url"); @@ -284,7 +284,7 @@ UINT CYandexService::Upload(FileTransferParam *ftp) } while (ftp->NextFile()); } catch (Exception &ex) { - Netlib_Logf(hConnection, "%s: %s", MODULE, ex.what()); + Netlib_Logf(m_hConnection, "%s: %s", MODULE, ex.what()); ftp->SetStatus(ACKRESULT_FAILED); return ACKRESULT_FAILED; } |