summaryrefslogtreecommitdiff
path: root/plugins/CloudFile
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
parentd8cab321e7428d723ef4fdbe0de947303589e8a0 (diff)
CloudFile: fix options
Diffstat (limited to 'plugins/CloudFile')
-rw-r--r--plugins/CloudFile/res/resource.rc12
-rw-r--r--plugins/CloudFile/src/Services/microsoft_service.cpp10
-rw-r--r--plugins/CloudFile/src/Services/yandex_service.cpp3
3 files changed, 14 insertions, 11 deletions
diff --git a/plugins/CloudFile/res/resource.rc b/plugins/CloudFile/res/resource.rc
index e1c06d953e..e08283ccb2 100644
--- a/plugins/CloudFile/res/resource.rc
+++ b/plugins/CloudFile/res/resource.rc
@@ -83,17 +83,17 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Download link",IDC_STATIC,5,100,297,57
+ LTEXT "Default service",IDC_STATIC,11,19,85,8
+ COMBOBOX IDC_DEFAULTSERVICE,102,17,194,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "General",IDC_STATIC,5,5,297,33
CONTROL "Autosend download link to contact",IDC_URL_AUTOSEND,
- "Button",BS_AUTORADIOBUTTON,11,114,282,10
+ "Button",BS_AUTORADIOBUTTON | WS_GROUP,11,114,282,10
CONTROL "Paste download link into message input area",IDC_URL_COPYTOMIA,
"Button",BS_AUTORADIOBUTTON,11,127,282,10
CONTROL "Copy download link to clipboard",IDC_URL_COPYTOCB,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,140,282,10
- GROUPBOX "General",IDC_STATIC,5,5,297,33
- COMBOBOX IDC_DEFAULTSERVICE,102,17,194,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- LTEXT "Default service",IDC_STATIC,11,19,85,8
- CONTROL "Do nothing",IDC_DONOTHINGONCONFLICT,"Button",BS_AUTORADIOBUTTON,11,54,51,10
+ GROUPBOX "Download link",IDC_STATIC,5,100,297,57
+ CONTROL "Do nothing",IDC_DONOTHINGONCONFLICT,"Button",BS_AUTORADIOBUTTON | WS_GROUP,11,54,285,10
CONTROL "Try to rename",IDC_RENAMEONCONFLICT,"Button",BS_AUTORADIOBUTTON,11,67,285,10
CONTROL "Try to replace",IDC_REPLACEONCONFLICT,"Button",BS_AUTORADIOBUTTON,11,80,285,10
GROUPBOX "On conflict when upload",IDC_STATIC,5,41,297,56
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);