diff options
author | George Hazan <ghazan@miranda.im> | 2019-01-28 15:51:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-01-28 15:51:04 +0300 |
commit | ac6607c5f76566c2c840ca3955a22448738df9b3 (patch) | |
tree | b697dbe07b88ac8fefb5f00a003c95710b3bbbeb /plugins/CloudFile | |
parent | e787987f54733bd58f69ced43a506aa7fc42fb7c (diff) |
mir_urlDecode & mir_urlEncode to return CMStringA
Diffstat (limited to 'plugins/CloudFile')
-rw-r--r-- | plugins/CloudFile/src/Services/microsoft_api.h | 8 | ||||
-rw-r--r-- | plugins/CloudFile/src/Services/yandex_api.h | 6 | ||||
-rw-r--r-- | plugins/CloudFile/src/http_request.h | 2 | ||||
-rw-r--r-- | plugins/CloudFile/src/stdafx.h | 1 |
4 files changed, 8 insertions, 9 deletions
diff --git a/plugins/CloudFile/src/Services/microsoft_api.h b/plugins/CloudFile/src/Services/microsoft_api.h index 62a2204459..6c22ac512f 100644 --- a/plugins/CloudFile/src/Services/microsoft_api.h +++ b/plugins/CloudFile/src/Services/microsoft_api.h @@ -48,7 +48,7 @@ namespace OneDriveAPI { public: UploadFileRequest(const char *token, const char *name, const char *data, size_t size, OnConflict strategy = NONE) : - HttpRequest(REQUEST_PUT, FORMAT, ONEDRIVE_API "/special/approot:/%s:/content", ptrA(mir_urlEncode(name))) + HttpRequest(REQUEST_PUT, FORMAT, ONEDRIVE_API "/special/approot:/%s:/content", mir_urlEncode(name).c_str()) { AddUrlParameter("select=id"); @@ -63,7 +63,7 @@ namespace OneDriveAPI } UploadFileRequest(const char *token, const char *parentId, const char *name, const char *data, size_t size, OnConflict strategy = NONE) : - HttpRequest(REQUEST_PUT, FORMAT, ONEDRIVE_API "/items/%s:/%s:/content", parentId, ptrA(mir_urlEncode(name))) + HttpRequest(REQUEST_PUT, FORMAT, ONEDRIVE_API "/items/%s:/%s:/content", parentId, mir_urlEncode(name).c_str()) { AddUrlParameter("select=id"); @@ -82,7 +82,7 @@ namespace OneDriveAPI { public: CreateUploadSessionRequest(const char *token, const char *name, OnConflict strategy = NONE) : - HttpRequest(REQUEST_POST, FORMAT, ONEDRIVE_API "/special/approot:/%s:/createUploadSession", ptrA(mir_urlEncode(name))) + HttpRequest(REQUEST_POST, FORMAT, ONEDRIVE_API "/special/approot:/%s:/createUploadSession", mir_urlEncode(name).c_str()) { AddBearerAuthHeader(token); AddHeader("Content-Type", "application/json"); @@ -102,7 +102,7 @@ namespace OneDriveAPI } CreateUploadSessionRequest(const char *token, const char *parentId, const char *name, OnConflict strategy = NONE) : - HttpRequest(REQUEST_POST, FORMAT, ONEDRIVE_API "/items/%s:/%s:/createUploadSession", parentId, ptrA(mir_urlEncode(name))) + HttpRequest(REQUEST_POST, FORMAT, ONEDRIVE_API "/items/%s:/%s:/createUploadSession", parentId, mir_urlEncode(name).c_str()) { AddBearerAuthHeader(token); AddHeader("Content-Type", "application/json"); diff --git a/plugins/CloudFile/src/Services/yandex_api.h b/plugins/CloudFile/src/Services/yandex_api.h index ac99cb0177..c7c3dfe19d 100644 --- a/plugins/CloudFile/src/Services/yandex_api.h +++ b/plugins/CloudFile/src/Services/yandex_api.h @@ -60,7 +60,7 @@ namespace YandexAPI HttpRequest(REQUEST_GET, YADISK_API "/upload") { AddOAuthHeader(token); - AddUrlParameter("path=app:%s", ptrA(mir_urlEncode(path))); + AddUrlParameter("path=app:%s", mir_urlEncode(path).c_str()); AddUrlParameter("fields=href"); if (strategy == OnConflict::REPLACE) AddUrlParameter("overwrite=true"); @@ -111,7 +111,7 @@ namespace YandexAPI HttpRequest(REQUEST_PUT, YADISK_API "/publish") { AddOAuthHeader(token); - AddUrlParameter("path=app:%s", ptrA(mir_urlEncode(path))); + AddUrlParameter("path=app:%s", mir_urlEncode(path).c_str()); } }; @@ -122,7 +122,7 @@ namespace YandexAPI HttpRequest(REQUEST_GET, YADISK_API) { AddOAuthHeader(token); - AddUrlParameter("path=app:%s", ptrA(mir_urlEncode(path))); + AddUrlParameter("path=app:%s", mir_urlEncode(path).c_str()); AddUrlParameter("fields=public_url"); } }; diff --git a/plugins/CloudFile/src/http_request.h b/plugins/CloudFile/src/http_request.h index db052604b8..c74b2ae40c 100644 --- a/plugins/CloudFile/src/http_request.h +++ b/plugins/CloudFile/src/http_request.h @@ -125,7 +125,7 @@ protected: m_szUrl.AppendFormat("%s=", name); CMStringA value; value.AppendFormatV(valueFormat, valueArgs); - m_szUrl.Append(ptrA(mir_urlEncode(value))); + m_szUrl += mir_urlEncode(value); va_end(valueArgs); } diff --git a/plugins/CloudFile/src/stdafx.h b/plugins/CloudFile/src/stdafx.h index 08628d1488..58801c4a34 100644 --- a/plugins/CloudFile/src/stdafx.h +++ b/plugins/CloudFile/src/stdafx.h @@ -22,7 +22,6 @@ #include <m_file.h> #include <m_langpack.h> #include <m_message.h> -#include <m_string.h> #include <m_gui.h> #include <m_chat.h> #include <m_http.h> |