summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/Services
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CloudFile/src/Services')
-rw-r--r--plugins/CloudFile/src/Services/dropbox_service.cpp26
-rw-r--r--plugins/CloudFile/src/Services/google_service.cpp24
-rw-r--r--plugins/CloudFile/src/Services/microsoft_service.cpp22
-rw-r--r--plugins/CloudFile/src/Services/yandex_service.cpp26
4 files changed, 49 insertions, 49 deletions
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp
index 16a9ee659f..f92787dec9 100644
--- a/plugins/CloudFile/src/Services/dropbox_service.cpp
+++ b/plugins/CloudFile/src/Services/dropbox_service.cpp
@@ -61,17 +61,17 @@ unsigned CDropboxService::RequestAccessTokenThread(void *owner, void *param)
GetDlgItemTextA(hwndDlg, IDC_OAUTH_CODE, requestToken, _countof(requestToken));
DropboxAPI::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) {
- Netlib_Logf(service->hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError());
+ Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError());
//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((wchar_t*)error_description, MB_ICONERROR);
return 0;
}
@@ -79,7 +79,7 @@ unsigned CDropboxService::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;
}
@@ -101,7 +101,7 @@ unsigned CDropboxService::RevokeAccessTokenThread(void *param)
ptrA token(db_get_sa(NULL, service->GetAccountName(), "TokenSecret"));
DropboxAPI::RevokeAccessTokenRequest request(token);
- NLHR_PTR response(request.Send(service->hConnection));
+ NLHR_PTR response(request.Send(service->m_hConnection));
return 0;
}
@@ -120,7 +120,7 @@ void CDropboxService::UploadFile(const char *data, size_t size, char *path)
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE);
DropboxAPI::UploadFileRequest request(token, path, data, size, (OnConflict)strategy);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("path_lower");
@@ -131,7 +131,7 @@ void CDropboxService::CreateUploadSession(const char *chunk, size_t chunkSize, c
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
DropboxAPI::CreateUploadSessionRequest request(token, chunk, chunkSize);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("session_id");
@@ -142,7 +142,7 @@ void CDropboxService::UploadFileChunk(const char *chunk, size_t chunkSize, const
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
DropboxAPI::UploadFileChunkRequest request(token, sessionId, offset, chunk, chunkSize);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
HandleHttpError(response);
}
@@ -152,7 +152,7 @@ void CDropboxService::CommitUploadSession(const char *data, size_t size, const c
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::REPLACE);
DropboxAPI::CommitUploadSessionRequest request(token, sessionId, offset, path, data, size, (OnConflict)strategy);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("path_lower");
@@ -163,7 +163,7 @@ void CDropboxService::CreateFolder(const char *path)
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
DropboxAPI::CreateFolderRequest request(token, path);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
HandleHttpError(response);
@@ -178,7 +178,7 @@ void CDropboxService::CreateSharedLink(const char *path, char *url)
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
DropboxAPI::CreateSharedLinkRequest shareRequest(token, path);
- NLHR_PTR response(shareRequest.Send(hConnection));
+ NLHR_PTR response(shareRequest.Send(m_hConnection));
if (response == nullptr)
throw Exception(HttpStatusToError());
@@ -206,7 +206,7 @@ void CDropboxService::CreateSharedLink(const char *path, char *url)
throw Exception(tag.c_str());
DropboxAPI::GetSharedLinkRequest getRequest(token, path);
- response = getRequest.Send(hConnection);
+ response = getRequest.Send(m_hConnection);
root = GetJsonResponse(response);
@@ -303,7 +303,7 @@ UINT CDropboxService::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;
}
diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp
index 3877506b0f..dda31097da 100644
--- a/plugins/CloudFile/src/Services/google_service.cpp
+++ b/plugins/CloudFile/src/Services/google_service.cpp
@@ -46,7 +46,7 @@ void CGDriveService::Login()
ptrA refreshToken(db_get_sa(NULL, GetAccountName(), "RefreshToken"));
if (token && refreshToken && refreshToken[0]) {
GDriveAPI::RefreshTokenRequest request(refreshToken);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
@@ -81,21 +81,21 @@ unsigned CGDriveService::RequestAccessTokenThread(void *owner, void *param)
GetDlgItemTextA(hwndDlg, IDC_OAUTH_CODE, requestToken, _countof(requestToken));
GDriveAPI::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;
}
@@ -103,7 +103,7 @@ unsigned CGDriveService::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;
}
@@ -131,7 +131,7 @@ unsigned CGDriveService::RevokeAccessTokenThread(void *param)
ptrA token(db_get_sa(NULL, service->GetAccountName(), "TokenSecret"));
GDriveAPI::RevokeAccessTokenRequest request(token);
- NLHR_PTR response(request.Send(service->hConnection));
+ NLHR_PTR response(request.Send(service->m_hConnection));
return 0;
}
@@ -149,7 +149,7 @@ void CGDriveService::UploadFile(const char *parentId, const char *name, const ch
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
GDriveAPI::UploadFileRequest request(token, parentId, name, data, size);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("id");
@@ -160,7 +160,7 @@ void CGDriveService::CreateUploadSession(const char *parentId, const char *name,
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
GDriveAPI::CreateUploadSessionRequest request(token, parentId, name);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
HandleHttpError(response);
@@ -181,7 +181,7 @@ void CGDriveService::CreateUploadSession(const char *parentId, const char *name,
void CGDriveService::UploadFileChunk(const char *uploadUri, const char *chunk, size_t chunkSize, uint64_t offset, uint64_t fileSize, char *fileId)
{
GDriveAPI::UploadFileChunkRequest request(uploadUri, chunk, chunkSize, offset, fileSize);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
HandleHttpError(response);
@@ -202,7 +202,7 @@ void CGDriveService::CreateFolder(const char *path, char *folderId)
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
GDriveAPI::CreateFolderRequest request(token, path);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("id");
@@ -213,7 +213,7 @@ void CGDriveService::CreateSharedLink(const char *itemId, char *url)
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
GDriveAPI::GrantPermissionsRequest request(token, itemId);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
HandleHttpError(response);
@@ -296,7 +296,7 @@ UINT CGDriveService::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;
}
diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp
index ec211f1244..6f5dfca836 100644
--- a/plugins/CloudFile/src/Services/microsoft_service.cpp
+++ b/plugins/CloudFile/src/Services/microsoft_service.cpp
@@ -46,7 +46,7 @@ void COneDriveService::Login()
ptrA refreshToken(db_get_sa(NULL, GetAccountName(), "RefreshToken"));
if (token && refreshToken && refreshToken[0]) {
OneDriveAPI::RefreshTokenRequest request(refreshToken);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
@@ -83,21 +83,21 @@ unsigned COneDriveService::RequestAccessTokenThread(void *owner, void *param)
GetDlgItemTextA(hwndDlg, IDC_OAUTH_CODE, requestToken, _countof(requestToken));
OneDriveAPI::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;
}
@@ -105,7 +105,7 @@ unsigned COneDriveService::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;
}
@@ -143,7 +143,7 @@ void COneDriveService::UploadFile(const char *parentId, const char *name, const
OneDriveAPI::UploadFileRequest *request = mir_strlen(parentId)
? new OneDriveAPI::UploadFileRequest(token, parentId, name, data, size, (OnConflict)strategy)
: new OneDriveAPI::UploadFileRequest(token, name, data, size, (OnConflict)strategy);
- NLHR_PTR response(request->Send(hConnection));
+ NLHR_PTR response(request->Send(m_hConnection));
delete request;
JSONNode root = GetJsonResponse(response);
@@ -158,7 +158,7 @@ void COneDriveService::CreateUploadSession(const char *parentId, const char *nam
OneDriveAPI::CreateUploadSessionRequest *request = mir_strlen(parentId)
? new OneDriveAPI::CreateUploadSessionRequest(token, parentId, name, (OnConflict)strategy)
: new OneDriveAPI::CreateUploadSessionRequest(token, name, (OnConflict)strategy);
- NLHR_PTR response(request->Send(hConnection));
+ NLHR_PTR response(request->Send(m_hConnection));
delete request;
JSONNode root = GetJsonResponse(response);
@@ -169,7 +169,7 @@ void COneDriveService::CreateUploadSession(const char *parentId, const char *nam
void COneDriveService::UploadFileChunk(const char *uploadUri, const char *chunk, size_t chunkSize, uint64_t offset, uint64_t fileSize, char *fileId)
{
OneDriveAPI::UploadFileChunkRequest request(uploadUri, chunk, chunkSize, offset, fileSize);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
HandleHttpError(response);
@@ -190,7 +190,7 @@ void COneDriveService::CreateFolder(const char *path, char *folderId)
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
OneDriveAPI::CreateFolderRequest request(token, path);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("id");
@@ -201,7 +201,7 @@ void COneDriveService::CreateSharedLink(const char *itemId, char *url)
{
ptrA token(db_get_sa(NULL, GetAccountName(), "TokenSecret"));
OneDriveAPI::CreateSharedLinkRequest request(token, itemId);
- NLHR_PTR response(request.Send(hConnection));
+ NLHR_PTR response(request.Send(m_hConnection));
JSONNode root = GetJsonResponse(response);
JSONNode node = root.at("link");
@@ -281,7 +281,7 @@ UINT COneDriveService::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;
}
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;
}