summaryrefslogtreecommitdiff
path: root/protocols/MSN/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-04 16:33:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-04 16:33:25 +0300
commit2f85d5d57ca99ff0f0530813a327b740086e0b1e (patch)
tree61a3a9b3050a02ed8bd01112d45a32faf4b80ca6 /protocols/MSN/src
parentc8a8a21467b39beb7fb02f4a4a36e3ccc2afba0e (diff)
mode code cleaning
Diffstat (limited to 'protocols/MSN/src')
-rw-r--r--protocols/MSN/src/msn_skypeab.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/protocols/MSN/src/msn_skypeab.cpp b/protocols/MSN/src/msn_skypeab.cpp
index 8f1abdaf74..ac107ce68f 100644
--- a/protocols/MSN/src/msn_skypeab.cpp
+++ b/protocols/MSN/src/msn_skypeab.cpp
@@ -328,13 +328,12 @@ bool CMsnProto::MSN_SKYABAuthRsp(const char *wlid, const char *pszAction)
bool CMsnProto::MSN_SKYABAuthRq(const char *wlid, const char *pszGreeting)
{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[4];
- bool bRet = false;
- CMStringA post;
-
// initialize the netlib request
- if (!APISkypeComRequest(&nlhr, headers)) return false;
+ NETLIBHTTPHEADER headers[4];
+ NETLIBHTTPREQUEST nlhr = { 0 };
+ if (!APISkypeComRequest(&nlhr, headers))
+ return false;
+
nlhr.requestType = REQUEST_PUT;
nlhr.szUrl = "https://contacts.skype.com/contacts/v2/users/SELF/contacts";
nlhr.headers[3].szName = "Content-type";
@@ -344,7 +343,8 @@ bool CMsnProto::MSN_SKYABAuthRq(const char *wlid, const char *pszGreeting)
node
<< JSONNode("mri", wlid)
<< JSONNode("greeting", pszGreeting);
- post = node.write().c_str();
+
+ CMStringA post = node.write().c_str();
nlhr.dataLength = post.GetLength();
nlhr.pData = (char*)(const char*)post;
@@ -354,10 +354,11 @@ bool CMsnProto::MSN_SKYABAuthRq(const char *wlid, const char *pszGreeting)
if (nlhrReply) {
hHttpsConnection = nlhrReply->nlc;
Netlib_FreeHttpRequest(nlhrReply);
- bRet = true;
+ return true;
}
- else hHttpsConnection = nullptr;
- return bRet;
+
+ hHttpsConnection = nullptr;
+ return false;
}
bool CMsnProto::MSN_SKYABSearch(const char *keyWord, HANDLE hSearch)
@@ -365,15 +366,17 @@ bool CMsnProto::MSN_SKYABSearch(const char *keyWord, HANDLE hSearch)
NETLIBHTTPREQUEST nlhr = { 0 };
NETLIBHTTPHEADER headers[4];
bool bRet = false;
- char szURL[256];
// initialize the netlib request
if (!APISkypeComRequest(&nlhr, headers)) {
ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, hSearch, 0);
return false;
}
- nlhr.requestType = REQUEST_GET;
+
+ char szURL[256];
mir_snprintf(szURL, sizeof(szURL), "https://api.skype.com/search/users/any?keyWord=%s&contactTypes[]=skype", keyWord);
+
+ nlhr.requestType = REQUEST_GET;
nlhr.szUrl = szURL;
nlhr.headers[3].szName = "Connection";
nlhr.headers[3].szValue = "keep-alive";