summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-28 15:51:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-28 15:51:04 +0300
commitac6607c5f76566c2c840ca3955a22448738df9b3 (patch)
treeb697dbe07b88ac8fefb5f00a003c95710b3bbbeb /protocols
parente787987f54733bd58f69ced43a506aa7fc42fb7c (diff)
mir_urlDecode & mir_urlEncode to return CMStringA
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Dummy/src/stdafx.h1
-rw-r--r--protocols/FacebookRM/src/messages.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp7
-rw-r--r--protocols/ICQ-WIM/src/options.cpp4
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp2
-rw-r--r--protocols/ICQ-WIM/src/server.cpp2
-rw-r--r--protocols/ICQ-WIM/src/utils.cpp4
-rw-r--r--protocols/JabberG/src/jabber_file.cpp6
-rwxr-xr-xprotocols/JabberG/src/stdafx.h1
-rw-r--r--protocols/MSN/src/msn_auth.cpp11
-rw-r--r--protocols/MSN/src/msn_menu.cpp2
-rw-r--r--protocols/MSN/src/msn_misc.cpp12
-rw-r--r--protocols/MSN/src/stdafx.h1
-rw-r--r--protocols/Sametime/src/StdAfx.h1
-rw-r--r--protocols/SkypeWeb/src/requests/capabilities.h2
-rw-r--r--protocols/SkypeWeb/src/requests/endpoint.h2
-rw-r--r--protocols/SkypeWeb/src/requests/history.h2
-rw-r--r--protocols/SkypeWeb/src/requests/login.h6
-rw-r--r--protocols/SkypeWeb/src/requests/messages.h2
-rw-r--r--protocols/SkypeWeb/src/requests/mslogin.h22
-rw-r--r--protocols/SkypeWeb/src/requests/oauth.h6
-rw-r--r--protocols/SkypeWeb/src/requests/trouter.h4
-rw-r--r--protocols/SkypeWeb/src/skype_search.cpp3
-rw-r--r--protocols/SkypeWeb/src/stdafx.h1
-rw-r--r--protocols/Steam/src/http_request.h4
-rw-r--r--protocols/Steam/src/stdafx.h1
-rw-r--r--protocols/Twitter/src/http.cpp2
-rw-r--r--protocols/VKontakte/src/misc.cpp2
-rw-r--r--protocols/VKontakte/src/stdafx.h1
29 files changed, 52 insertions, 64 deletions
diff --git a/protocols/Dummy/src/stdafx.h b/protocols/Dummy/src/stdafx.h
index a921985f35..3655b635ae 100644
--- a/protocols/Dummy/src/stdafx.h
+++ b/protocols/Dummy/src/stdafx.h
@@ -48,7 +48,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_protosvc.h>
#include <m_protoint.h>
#include <m_skin.h>
-#include <m_string.h>
#include <m_timezones.h>
#include <m_toptoolbar.h>
#include <m_userinfo.h>
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index d3e8461cc9..dc103b739d 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -326,7 +326,7 @@ HttpRequest* facebook_client::markMessageReadRequest(const LIST<char> &ids)
if (id_.substr(0, 3) == "id.")
id_ = id_.substr(3);
- CMStringA id(::FORMAT, "ids[%s]", ptrA(mir_urlEncode(id_.c_str())));
+ CMStringA id(::FORMAT, "ids[%s]", mir_urlEncode(id_.c_str()).c_str());
p->Body << BOOL_PARAM(id, true);
}
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index ab7356ec0a..58ec424d37 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -384,17 +384,16 @@ void __cdecl GaduProto::setavatarthread(void *param)
ptrA avatarFileB64(mir_base64_encode(avatarFile, avatarFileLen));
mir_free(avatarFile);
- ptrA avatarFileB64Enc(mir_urlEncode(avatarFileB64));
- size_t avatarFileB64EncLen = mir_strlen(avatarFileB64Enc);
+ CMStringA avatarFileB64Enc(mir_urlEncode(avatarFileB64));
char dataPrefix[64];
mir_snprintf(dataPrefix, "uin=%d&photo=", getDword(GG_KEY_UIN, 0));
size_t dataPrefixLen = mir_strlen(dataPrefix);
- size_t dataLen = dataPrefixLen + avatarFileB64EncLen;
+ size_t dataLen = dataPrefixLen + avatarFileB64Enc.GetLength();
char* data = (char*)mir_alloc(dataLen);
memcpy(data, dataPrefix, dataPrefixLen);
- memcpy(data + dataPrefixLen, avatarFileB64Enc, avatarFileB64EncLen);
+ memcpy(data + dataPrefixLen, avatarFileB64Enc, avatarFileB64Enc.GetLength());
//check if we have token, if no - receive new one
oauth_checktoken(0);
diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp
index 3a9d3be3f1..20261a9585 100644
--- a/protocols/ICQ-WIM/src/options.cpp
+++ b/protocols/ICQ-WIM/src/options.cpp
@@ -140,11 +140,11 @@ void CIcqProto::OnLoginViaPhone(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest *pRe
const JSONNode &data = root.data();
m_szAToken = data["token"]["a"].as_mstring();
- m_szAToken = ptrA(mir_urlDecode(m_szAToken));
+ m_szAToken = mir_urlDecode(m_szAToken);
setString(DB_KEY_ATOKEN, m_szAToken);
m_szSessionKey = data["sessionKey"].as_mstring();
- m_szSessionKey = ptrA(mir_urlDecode(m_szSessionKey));
+ m_szSessionKey = mir_urlDecode(m_szSessionKey);
setString(DB_KEY_SESSIONKEY, m_szSessionKey);
m_dwUin = _wtoi(data["loginId"].as_mstring());
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index bebceafef8..52620647ca 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -377,7 +377,7 @@ HANDLE CIcqProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFile
pwszFileName = ppszFiles[0];
auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, "https://files.icq.com/files/init", &CIcqProto::OnFileInit);
- pReq << CHAR_PARAM("a", m_szAToken) << CHAR_PARAM("client", "icq") << CHAR_PARAM("f", "json") << CHAR_PARAM("fileName", ptrA(mir_urlEncode(T2Utf(pwszFileName))))
+ pReq << CHAR_PARAM("a", m_szAToken) << CHAR_PARAM("client", "icq") << CHAR_PARAM("f", "json") << CHAR_PARAM("fileName", mir_urlEncode(T2Utf(pwszFileName)))
<< CHAR_PARAM("k", ICQ_APP_ID) << INT_PARAM("size", statbuf.st_size) << INT_PARAM("ts", time(0));
CalcHash(pReq);
pReq->pUserInfo = pTransfer;
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 369b732e59..06994acbb1 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -467,7 +467,7 @@ void CIcqProto::OnCheckPassword(NETLIBHTTPREQUEST *pReply, AsyncHttpRequest*)
JSONNode &data = root.data();
m_szAToken = data["token"]["a"].as_mstring();
- m_szAToken = ptrA(mir_urlDecode(m_szAToken));
+ m_szAToken = mir_urlDecode(m_szAToken);
setString(DB_KEY_ATOKEN, m_szAToken);
CMStringA szSessionSecret = data["sessionSecret"].as_mstring();
diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp
index f372d71de5..a962cb6a3c 100644
--- a/protocols/ICQ-WIM/src/utils.cpp
+++ b/protocols/ICQ-WIM/src/utils.cpp
@@ -62,7 +62,7 @@ void CIcqProto::CalcHash(AsyncHttpRequest *pReq)
{
CMStringA hashData(FORMAT, "%s&%s&%s",
pReq->requestType == REQUEST_POST ? "POST" : "GET",
- ptrA(mir_urlEncode(pReq->m_szUrl)), ptrA(mir_urlEncode(pReq->m_szParam)));
+ mir_urlEncode(pReq->m_szUrl).c_str(), mir_urlEncode(pReq->m_szParam).c_str());
unsigned int len;
BYTE hashOut[MIR_SHA256_HASH_SIZE];
@@ -170,7 +170,7 @@ INT_PTR __cdecl CIcqProto::SetAvatar(WPARAM, LPARAM lParam)
_wremove(wszOldName);
auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_POST, ICQ_API_SERVER "/expressions/upload");
- pReq->m_szUrl.AppendFormat("?f=json&aimsid=%s&r=%s&type=largeBuddyIcon", ptrA(mir_urlEncode(m_aimsid.c_str())), pReq->m_reqId);
+ pReq->m_szUrl.AppendFormat("?f=json&aimsid=%s&r=%s&type=largeBuddyIcon", mir_urlEncode(m_aimsid.c_str()).c_str(), pReq->m_reqId);
if (pwszFileName == nullptr)
delSetting("AvatarHash");
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index ec653ca3c1..4c77f434c0 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -279,8 +279,8 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
else
p = ft->std.pszFiles.w[i];
- ptrA pFileName(mir_urlEncode(T2Utf(p)));
- if (pFileName != nullptr) {
+ CMStringA pFileName(mir_urlEncode(T2Utf(p)));
+ if (!pFileName.IsEmpty()) {
ft->szId = JabberId2string(SerialNext());
ptrA myAddr;
@@ -294,7 +294,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
}
char szAddr[256];
- mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
+ mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName.c_str());
size_t len = mir_wstrlen(ptszResource) + mir_wstrlen(ft->jid) + 2;
wchar_t *fulljid = (wchar_t *)alloca(sizeof(wchar_t) * len);
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index 3fd27902d3..105e805d61 100755
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -78,7 +78,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_protoint.h>
#include <m_skin.h>
#include <m_json.h>
-#include <m_string.h>
#include <m_timezones.h>
#include <m_toptoolbar.h>
#include <m_userinfo.h>
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp
index 5f54249d69..02da53e8c9 100644
--- a/protocols/MSN/src/msn_auth.cpp
+++ b/protocols/MSN/src/msn_auth.cpp
@@ -559,16 +559,16 @@ CMStringA CMsnProto::HotmailLogin(const char* url)
derive_key(key2, key1, key1len, data1, data1len);
CMStringA result;
- result.Format("%s&da=%s&nonce=", url, ptrA(mir_urlEncode(hotAuthToken)));
+ result.Format("%s&da=%s&nonce=", url, mir_urlEncode(hotAuthToken).c_str());
ptrA noncenc(mir_base64_encode(nonce, sizeof(nonce)));
- result.Append(ptrA(mir_urlEncode(noncenc)));
+ result.Append(mir_urlEncode(noncenc));
BYTE hash[MIR_SHA1_HASH_SIZE];
unsigned int len;
HMAC(EVP_sha1(), key2, sizeof(key2), (BYTE*)result.GetString(), result.GetLength(), hash, &len);
ptrA szHash(mir_base64_encode(hash, sizeof(hash)));
- result.AppendFormat("&hash=%s", ptrA(mir_urlEncode(szHash)));
+ result.AppendFormat("&hash=%s", mir_urlEncode(szHash).c_str());
return result;
}
@@ -690,7 +690,7 @@ bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService
nlhr.headers[1].szValue = "application/x-www-form-urlencoded";
nlhr.headers[2].szName = "Cookie";
nlhr.headers[2].szValue = authCookies;
- post.Format("client_id=00000000480BC46C&scope=%s&grant_type=refresh_token&refresh_token=%s", ptrA(mir_urlEncode(pszService)), pszRefreshToken);
+ post.Format("client_id=00000000480BC46C&scope=%s&grant_type=refresh_token&refresh_token=%s", mir_urlEncode(pszService).c_str(), pszRefreshToken);
nlhr.pData = (char*)(const char*)post;
nlhr.dataLength = (int)mir_strlen(nlhr.pData);
@@ -930,8 +930,7 @@ bool CMsnProto::parseLoginPage(char *pszHTML, NETLIBHTTPREQUEST *nlhr, CMStringA
if (db_get_static(NULL, m_szModuleName, "Password", szPassword, sizeof(szPassword)))
return false;
szPassword[99] = 0;
- post->Format("PPFT=%s&login=%s&passwd=%s", ptrA(mir_urlEncode(pPPFT)),
- ptrA(mir_urlEncode(MyOptions.szEmail)), ptrA(mir_urlEncode(szPassword)));
+ post->Format("PPFT=%s&login=%s&passwd=%s", mir_urlEncode(pPPFT).c_str(), mir_urlEncode(MyOptions.szEmail).c_str(), mir_urlEncode(szPassword).c_str());
/* Do the login and get the required tokens */
nlhr->dataLength = post->GetLength();
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index b216212d37..70c00d637f 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -59,7 +59,7 @@ INT_PTR CMsnProto::MsnSendHotmail(WPARAM hContact, LPARAM)
if (MSN_IsMeByContact(hContact, szEmail))
MsnGotoInbox(0, 0);
else if (msnLoggedIn)
- MsnInvokeMyURL(true, CMStringA().Format("http://mail.live.com?rru=compose?to=%s", ptrA(mir_urlEncode(szEmail))));
+ MsnInvokeMyURL(true, CMStringA().Format("http://mail.live.com?rru=compose?to=%s", mir_urlEncode(szEmail).c_str()));
return 0;
}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 0557aeba8c..2946b53418 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -254,10 +254,8 @@ int CMsnProto::MSN_SetMyAvatar(const wchar_t* sztFname, void* pData, size_t cbLe
// ezxml_set_attr(xmlp, "SHA1C", szSha1c);
- char* szBuffer = ezxml_toxml(xmlp, false);
+ ptrA szBuffer(ezxml_toxml(xmlp, false));
ezxml_free(xmlp);
- ptrA szEncodedBuffer(mir_urlEncode(szBuffer));
- free(szBuffer);
const wchar_t *szExt;
int fmt = ProtoGetBufferFormat(pData, &szExt);
@@ -279,7 +277,7 @@ int CMsnProto::MSN_SetMyAvatar(const wchar_t* sztFname, void* pData, size_t cbLe
if (!db_get_static(NULL, m_szModuleName, "AvatarHash", szAvatarHashdOld, sizeof(szAvatarHashdOld))) {
char *szAvatarHash = arrayToHex(sha1d, sizeof(sha1d));
if (mir_strcmp(szAvatarHashdOld, szAvatarHash)) {
- setString("PictObject", szEncodedBuffer);
+ setString("PictObject", mir_urlEncode(szBuffer));
setString("AvatarHash", szAvatarHash);
}
mir_free(szAvatarHash);
@@ -405,7 +403,7 @@ int ThreadData::sendMessage(int, const char *email, int netId, const char *parMs
break;
if (*p == 0) {
- strncpy_s(tFontName, sizeof(tFontName), ptrA(mir_urlEncode(dbv.pszVal)), _TRUNCATE);
+ strncpy_s(tFontName, sizeof(tFontName), mir_urlEncode(dbv.pszVal), _TRUNCATE);
db_free(&dbv);
}
}
@@ -710,10 +708,10 @@ void CMsnProto::MsnInvokeMyURL(bool ismail, const char* url)
if (p)
*p = 0;
- CMStringA post = HotmailLogin(CMStringA().Format(postdata, (unsigned)time(0), ptrA(mir_urlEncode(url))));
+ CMStringA post = HotmailLogin(CMStringA().Format(postdata, (unsigned)time(0), mir_urlEncode(url).c_str()));
if (!post.IsEmpty()) {
CMStringA hippy(passport);
- hippy.AppendFormat("/ppsecure/sha1auth.srf?lc=%d&token=%s", itoa(langpref, passport, 10), ptrA(mir_urlEncode(post)));
+ hippy.AppendFormat("/ppsecure/sha1auth.srf?lc=%d&token=%s", itoa(langpref, passport, 10), mir_urlEncode(post).c_str());
debugLogA("Starting URL: '%s'", hippy.c_str());
Utils_OpenUrl(hippy.GetString());
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h
index bf6c0703c8..ab5303e074 100644
--- a/protocols/MSN/src/stdafx.h
+++ b/protocols/MSN/src/stdafx.h
@@ -61,7 +61,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_timezones.h>
#include <m_extraicons.h>
#include <m_nudge.h>
-#include <m_string.h>
#include <m_json.h>
#include "m_proto_listeningto.h"
diff --git a/protocols/Sametime/src/StdAfx.h b/protocols/Sametime/src/StdAfx.h
index 5fa7d2b4d3..86a25658ad 100644
--- a/protocols/Sametime/src/StdAfx.h
+++ b/protocols/Sametime/src/StdAfx.h
@@ -74,4 +74,3 @@ extern "C" {
#include <m_chat.h>
#include <m_genmenu.h>
#include <m_icolib.h>
-#include <m_string.h>
diff --git a/protocols/SkypeWeb/src/requests/capabilities.h b/protocols/SkypeWeb/src/requests/capabilities.h
index 5cf4524f67..174b486ed7 100644
--- a/protocols/SkypeWeb/src/requests/capabilities.h
+++ b/protocols/SkypeWeb/src/requests/capabilities.h
@@ -22,7 +22,7 @@ class SendCapabilitiesRequest : public HttpRequest
{
public:
SendCapabilitiesRequest(const char *hostname, LoginInfo &li) :
- HttpRequest(REQUEST_PUT, FORMAT, "%s/v1/users/ME/endpoints/%s/presenceDocs/messagingService", li.endpoint.szServer, ptrA(mir_urlEncode(li.endpoint.szId)))
+ HttpRequest(REQUEST_PUT, FORMAT, "%s/v1/users/ME/endpoints/%s/presenceDocs/messagingService", li.endpoint.szServer, mir_urlEncode(li.endpoint.szId).c_str())
{
Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h
index fb75857195..70cc922fcd 100644
--- a/protocols/SkypeWeb/src/requests/endpoint.h
+++ b/protocols/SkypeWeb/src/requests/endpoint.h
@@ -37,7 +37,7 @@ class DeleteEndpointRequest : public HttpRequest
{
public:
DeleteEndpointRequest(LoginInfo &li) :
- HttpRequest(REQUEST_DELETE, FORMAT, "%s/v1/users/ME/endpoints/%s", li.endpoint.szServer, ptrA(mir_urlEncode(li.endpoint.szId)))
+ HttpRequest(REQUEST_DELETE, FORMAT, "%s/v1/users/ME/endpoints/%s", li.endpoint.szServer, mir_urlEncode(li.endpoint.szId).c_str())
{
Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
diff --git a/protocols/SkypeWeb/src/requests/history.h b/protocols/SkypeWeb/src/requests/history.h
index 28a4816c02..2f82821b31 100644
--- a/protocols/SkypeWeb/src/requests/history.h
+++ b/protocols/SkypeWeb/src/requests/history.h
@@ -50,7 +50,7 @@ class GetHistoryRequest : public HttpRequest
{
public:
GetHistoryRequest(const char *username, int pageSize, bool isChat, LONGLONG timestamp, LoginInfo &li) :
- HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/conversations/%d:%s/messages", li.endpoint.szServer, isChat ? 19 : 8, ptrA(mir_urlEncode(username)))
+ HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/conversations/%d:%s/messages", li.endpoint.szServer, isChat ? 19 : 8, mir_urlEncode(username).c_str())
{
Url
<< LONG_VALUE("startTime", timestamp)
diff --git a/protocols/SkypeWeb/src/requests/login.h b/protocols/SkypeWeb/src/requests/login.h
index 703cc89f62..a76dd3d15d 100644
--- a/protocols/SkypeWeb/src/requests/login.h
+++ b/protocols/SkypeWeb/src/requests/login.h
@@ -32,9 +32,9 @@ public:
Body
<< CHAR_VALUE("scopes", "client")
- << CHAR_VALUE("clientVersion", ptrA(mir_urlEncode("0/7.4.85.102/259/")))
- << CHAR_VALUE("username", ptrA(mir_urlEncode(username)))
- << CHAR_VALUE("passwordHash", pass_ptrA(mir_urlEncode(ptrA(mir_base64_encode(digest, sizeof(digest))))));
+ << CHAR_VALUE("clientVersion", mir_urlEncode("0/7.4.85.102/259/").c_str())
+ << CHAR_VALUE("username", mir_urlEncode(username).c_str())
+ << CHAR_VALUE("passwordHash", mir_urlEncode(ptrA(mir_base64_encode(digest, sizeof(digest)))).c_str());
}
};
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h
index 6e020d0a4c..d2cf5d69dc 100644
--- a/protocols/SkypeWeb/src/requests/messages.h
+++ b/protocols/SkypeWeb/src/requests/messages.h
@@ -70,7 +70,7 @@ class SendTypingRequest : public HttpRequest
{
public:
SendTypingRequest(const char *username, int iState, LoginInfo &li) :
- HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages", li.endpoint.szServer, ptrA(mir_urlEncode(username)))
+ HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages", li.endpoint.szServer, mir_urlEncode(username).c_str())
{
Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
diff --git a/protocols/SkypeWeb/src/requests/mslogin.h b/protocols/SkypeWeb/src/requests/mslogin.h
index cbfd5815a1..7064847454 100644
--- a/protocols/SkypeWeb/src/requests/mslogin.h
+++ b/protocols/SkypeWeb/src/requests/mslogin.h
@@ -28,7 +28,7 @@ public:
Url
<< INT_VALUE ("client_id", 578134)
- << CHAR_VALUE ("redirect_uri", ptrA(mir_urlEncode("https://web.skype.com")));
+ << CHAR_VALUE ("redirect_uri", mir_urlEncode("https://web.skype.com"));
}
LoginMSRequest(const char *login, const char *password, const char *cookies_str, const char *ppft) :
HttpRequest(REQUEST_POST, "login.live.com/ppsecure/post.srf")
@@ -42,8 +42,8 @@ public:
<< CHAR_VALUE ("Cookie", cookies_str);
Body
- << CHAR_VALUE ("login", ptrA(mir_urlEncode(login)))
- << CHAR_VALUE ("passwd", ptrA(mir_urlEncode(password)))
+ << CHAR_VALUE ("login", mir_urlEncode(login))
+ << CHAR_VALUE ("passwd", mir_urlEncode(password))
<< CHAR_VALUE ("PPFT", ppft);
}
LoginMSRequest(const char *t) :
@@ -51,16 +51,16 @@ public:
{
Url
<< INT_VALUE ("client_id", 578134)
- << CHAR_VALUE ("redirect_uri", ptrA(mir_urlEncode("https://web.skype.com")));
+ << CHAR_VALUE ("redirect_uri", mir_urlEncode("https://web.skype.com"));
Headers
<< CHAR_VALUE ("Content-Type", "application/x-www-form-urlencoded");
Body
- << CHAR_VALUE ("t", ptrA(mir_urlEncode(t)))
+ << CHAR_VALUE ("t", mir_urlEncode(t))
<< INT_VALUE ("oauthPartner", 999)
<< INT_VALUE ("client_id", 578134)
- << CHAR_VALUE ("redirect_uri", ptrA(mir_urlEncode("https://web.skype.com")));
+ << CHAR_VALUE ("redirect_uri", mir_urlEncode("https://web.skype.com"));
}
LoginMSRequest(const char *t, int) :
@@ -68,16 +68,16 @@ public:
{
Url
<< INT_VALUE ("client_id", 578134)
- << CHAR_VALUE ("redirect_uri", ptrA(mir_urlEncode("https://web.skype.com")));
+ << CHAR_VALUE ("redirect_uri", mir_urlEncode("https://web.skype.com"));
Headers
<< CHAR_VALUE ("Content-Type", "application/x-www-form-urlencoded");
Body
- << CHAR_VALUE ("t", ptrA(mir_urlEncode(t)))
+ << CHAR_VALUE ("t", mir_urlEncode(t))
<< INT_VALUE ("oauthPartner", 999)
<< INT_VALUE ("client_id", 578134)
- << CHAR_VALUE ("redirect_uri", ptrA(mir_urlEncode("https://web.skype.com")));
+ << CHAR_VALUE ("redirect_uri", mir_urlEncode("https://web.skype.com"));
}
LoginMSRequest(const char *url, const char *login, const char *cookies_str, const char *ppft, const char *code) :
@@ -88,9 +88,9 @@ public:
Body
<< CHAR_VALUE ("oct", code)
<< INT_VALUE ("AdTD", 1)
- << CHAR_VALUE ("login", ptrA(mir_urlEncode(login)))
+ << CHAR_VALUE ("login", mir_urlEncode(login))
<< INT_VALUE ("type", 19)
- << CHAR_VALUE ("PPFT", ptrA(mir_urlEncode(ppft)));
+ << CHAR_VALUE ("PPFT", mir_urlEncode(ppft));
}
};
diff --git a/protocols/SkypeWeb/src/requests/oauth.h b/protocols/SkypeWeb/src/requests/oauth.h
index 6b5fba438d..b633e04db8 100644
--- a/protocols/SkypeWeb/src/requests/oauth.h
+++ b/protocols/SkypeWeb/src/requests/oauth.h
@@ -47,8 +47,8 @@ public:
<< CHAR_VALUE("Cookie", cookies);
Body
- << CHAR_VALUE("login", ptrA(mir_urlEncode(login)))
- << CHAR_VALUE("passwd", ptrA(mir_urlEncode(password)))
+ << CHAR_VALUE("login", mir_urlEncode(login))
+ << CHAR_VALUE("passwd", mir_urlEncode(password))
<< CHAR_VALUE("PPFT", ppft);
}
@@ -59,7 +59,7 @@ public:
<< CHAR_VALUE ("Content-Type", "application/x-www-form-urlencoded");
Body
- << CHAR_VALUE ("t", ptrA(mir_urlEncode(t)))
+ << CHAR_VALUE ("t", mir_urlEncode(t))
<< CHAR_VALUE("site_name", "lw.skype.com")
<< INT_VALUE ("oauthPartner", 999);
}
diff --git a/protocols/SkypeWeb/src/requests/trouter.h b/protocols/SkypeWeb/src/requests/trouter.h
index 5441b4092a..7373a4ec57 100644
--- a/protocols/SkypeWeb/src/requests/trouter.h
+++ b/protocols/SkypeWeb/src/requests/trouter.h
@@ -118,7 +118,7 @@ public:
<< CHAR_VALUE("v", "v2")
<< INT_VALUE("p", 443)
<< CHAR_VALUE("ccid", ccid.c_str())
- << CHAR_VALUE("tc", ptrA(mir_urlEncode("{\"cv\":\"2014.8.26\",\"hr\":\"\",\"ua\":\"Miranda_NG\",\"v\":\"\"}")))
+ << CHAR_VALUE("tc", mir_urlEncode("{\"cv\":\"2014.8.26\",\"hr\":\"\",\"ua\":\"Miranda_NG\",\"v\":\"\"}"))
<< LONG_VALUE("t", time(NULL) * 1000);
Headers
@@ -146,7 +146,7 @@ public:
<< CHAR_VALUE("v", "v2")
<< INT_VALUE("p", 443)
<< CHAR_VALUE("ccid", ccid.c_str())
- << CHAR_VALUE("tc", ptrA(mir_urlEncode("{\"cv\":\"2014.8.26\",\"hr\":\"\",\"ua\":\"Miranda_NG\",\"v\":\"\"}")))
+ << CHAR_VALUE("tc", mir_urlEncode("{\"cv\":\"2014.8.26\",\"hr\":\"\",\"ua\":\"Miranda_NG\",\"v\":\"\"}"))
<< LONG_VALUE("t", time(NULL) * 1000);
Headers
diff --git a/protocols/SkypeWeb/src/skype_search.cpp b/protocols/SkypeWeb/src/skype_search.cpp
index eac043d5d4..28a3a32344 100644
--- a/protocols/SkypeWeb/src/skype_search.cpp
+++ b/protocols/SkypeWeb/src/skype_search.cpp
@@ -27,8 +27,7 @@ void CSkypeProto::SearchBasicThread(void* id)
{
debugLogA("CSkypeProto::OnSearchBasicThread");
if (IsOnline()) {
- ptrA szString(mir_urlEncode(T2Utf((wchar_t*)id)));
- SendRequest(new GetSearchRequest(szString, li), &CSkypeProto::OnSearch);
+ SendRequest(new GetSearchRequest(mir_urlEncode(T2Utf((wchar_t*)id)), li), &CSkypeProto::OnSearch);
}
}
diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h
index bf477f5cd3..bf98658877 100644
--- a/protocols/SkypeWeb/src/stdafx.h
+++ b/protocols/SkypeWeb/src/stdafx.h
@@ -49,7 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_chat_int.h>
#include <m_genmenu.h>
#include <m_clc.h>
-#include <m_string.h>
#include <m_json.h>
#include <m_gui.h>
#include <m_imgsrvc.h>
diff --git a/protocols/Steam/src/http_request.h b/protocols/Steam/src/http_request.h
index 3d87defe43..7e8213b87d 100644
--- a/protocols/Steam/src/http_request.h
+++ b/protocols/Steam/src/http_request.h
@@ -80,7 +80,7 @@ public:
HttpUri &operator<<(const CHAR_PARAM &param)
{
- AppendFormat("%s=%s", param.szName, ptrA(mir_urlEncode(param.szValue)));
+ AppendFormat("%s=%s", param.szName, mir_urlEncode(param.szValue).c_str());
return *this;
}
};
@@ -269,7 +269,7 @@ __forceinline FormUrlEncodedContent* operator<<(FormUrlEncodedContent *content,
__forceinline FormUrlEncodedContent* operator<<(FormUrlEncodedContent *content, const CHAR_PARAM &param)
{
- content->AppendFormat("%s=%s", param.szName, ptrA(mir_urlEncode(param.szValue)));
+ content->AppendFormat("%s=%s", param.szName, mir_urlEncode(param.szValue).c_str());
return content;
}
diff --git a/protocols/Steam/src/stdafx.h b/protocols/Steam/src/stdafx.h
index 9eb34490c8..0783ee01e4 100644
--- a/protocols/Steam/src/stdafx.h
+++ b/protocols/Steam/src/stdafx.h
@@ -24,7 +24,6 @@
#include <m_skin.h>
#include <m_clist.h>
#include <m_genmenu.h>
-#include <m_string.h>
#include <m_imgsrvc.h>
#include <m_protocols.h>
#include <m_protosvc.h>
diff --git a/protocols/Twitter/src/http.cpp b/protocols/Twitter/src/http.cpp
index 892dca34ca..200a3d0adb 100644
--- a/protocols/Twitter/src/http.cpp
+++ b/protocols/Twitter/src/http.cpp
@@ -21,5 +21,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
std::string http::url_encode(const std::string &s)
{
- return (char*)ptrA(mir_urlEncode(s.c_str()));
+ return mir_urlEncode(s.c_str());
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 582aa00481..6951a76f56 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -462,7 +462,7 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul
if (!result.IsEmpty())
result.AppendChar('&');
result += name + "=";
- result += ptrA(mir_urlEncode(value));
+ result += mir_urlEncode(value);
}
}
diff --git a/protocols/VKontakte/src/stdafx.h b/protocols/VKontakte/src/stdafx.h
index 2fbaf54151..d55c2bd606 100644
--- a/protocols/VKontakte/src/stdafx.h
+++ b/protocols/VKontakte/src/stdafx.h
@@ -35,7 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <m_genmenu.h>
#include <m_icolib.h>
#include <m_imgsrvc.h>
-#include <m_string.h>
#include <m_json.h>
#include <m_langpack.h>
#include <m_message.h>