summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-05-09 23:56:56 +0300
committeraunsane <aunsane@gmail.com>2017-05-09 23:56:56 +0300
commite6b569f5f636c548fa253171f86b7a0f96fe1817 (patch)
treefd08a0bcae95893a8f70852fd06532139be02b10 /plugins/CloudFile/src
parentd8cab321e7428d723ef4fdbe0de947303589e8a0 (diff)
CloudFile: fix options
Diffstat (limited to 'plugins/CloudFile/src')
-rw-r--r--plugins/CloudFile/src/Services/microsoft_service.cpp10
-rw-r--r--plugins/CloudFile/src/Services/yandex_service.cpp3
2 files changed, 8 insertions, 5 deletions
diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp
index af4dd6f703..aa2b8613b4 100644
--- a/plugins/CloudFile/src/Services/microsoft_service.cpp
+++ b/plugins/CloudFile/src/Services/microsoft_service.cpp
@@ -130,9 +130,10 @@ void COneDriveService::HandleJsonError(JSONNode &node)
void COneDriveService::UploadFile(const char *parentId, const char *name, const char *data, size_t size, char *fileId)
{
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
+ BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::NONE);
OneDriveAPI::UploadFileRequest *request = mir_strlen(parentId)
- ? new OneDriveAPI::UploadFileRequest(token, parentId, name, data, size)
- : new OneDriveAPI::UploadFileRequest(token, name, data, size);
+ ? 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));
delete request;
@@ -144,9 +145,10 @@ void COneDriveService::UploadFile(const char *parentId, const char *name, const
void COneDriveService::CreateUploadSession(const char *parentId, const char *name, char *uploadUri)
{
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
+ BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::NONE);
OneDriveAPI::CreateUploadSessionRequest *request = mir_strlen(parentId)
- ? new OneDriveAPI::CreateUploadSessionRequest(token, parentId, name)
- : new OneDriveAPI::CreateUploadSessionRequest(token, name);
+ ? new OneDriveAPI::CreateUploadSessionRequest(token, parentId, name, (OnConflict)strategy)
+ : new OneDriveAPI::CreateUploadSessionRequest(token, name, (OnConflict)strategy);
NLHR_PTR response(request->Send(hConnection));
delete request;
diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp
index 04d63138c0..cef1aadc45 100644
--- a/plugins/CloudFile/src/Services/yandex_service.cpp
+++ b/plugins/CloudFile/src/Services/yandex_service.cpp
@@ -142,7 +142,8 @@ void CYandexService::HandleJsonError(JSONNode &node)
void CYandexService::CreateUploadSession(const char *path, char *uploadUri)
{
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
- YandexAPI::GetUploadUrlRequest request(token, path);
+ BYTE strategy = db_get_b(NULL, MODULE, "ConflictStrategy", OnConflict::NONE);
+ YandexAPI::GetUploadUrlRequest request(token, path, (OnConflict)strategy);
NLHR_PTR response(request.Send(hConnection));
JSONNode root = GetJsonResponse(response);