summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-23 18:04:59 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-23 18:04:59 +0000
commitceb5a959c77bbfdb5f5054d6d694032aa323f674 (patch)
tree2a9bedb244201053be39ffbce6fbd86be87e1469 /protocols/SkypeWeb/src/requests
parent4c42f50401b69f7ba0c87ea5d315173f0c9a8fcf (diff)
SkypeWeb: status support pt2 (patch from MikalaiR)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12487 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r--protocols/SkypeWeb/src/requests/endpoint.h5
-rw-r--r--protocols/SkypeWeb/src/requests/login.h8
-rw-r--r--protocols/SkypeWeb/src/requests/reg_info.h6
-rw-r--r--protocols/SkypeWeb/src/requests/status.h4
4 files changed, 16 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h
index a6878f3f1f..3bd6827ac4 100644
--- a/protocols/SkypeWeb/src/requests/endpoint.h
+++ b/protocols/SkypeWeb/src/requests/endpoint.h
@@ -8,11 +8,12 @@ public:
HttpsRequest(REQUEST_PUT, endpointURL)
{
flags |= NLHRF_SSL;
-
+ CMStringA auth = "registrationToken=";
+ auth += regToken;
Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
- << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
+ << CHAR_VALUE("RegistrationToken", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
<< CHAR_VALUE("Origin", "https://web.skype.com")
diff --git a/protocols/SkypeWeb/src/requests/login.h b/protocols/SkypeWeb/src/requests/login.h
index 8c45c7237c..c7924a842c 100644
--- a/protocols/SkypeWeb/src/requests/login.h
+++ b/protocols/SkypeWeb/src/requests/login.h
@@ -7,24 +7,28 @@ public:
LoginRequest() :
HttpsPostRequest("login.skype.com/login")
{
+ //flags = NLHRF_SSL | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT;
Url
<< INT_VALUE("client_id", 578134)
<< CHAR_VALUE("redirect_uri", "https%3A%2F%2Fweb.skype.com");
Headers
- << CHAR_VALUE("Host", "login.skype.com");
+ << CHAR_VALUE("Host", "login.skype.com")
+ << CHAR_VALUE("Connection", "keep-alive");
}
LoginRequest(const char *skypename, const char *password, const char *pie, const char *etm) :
HttpsPostRequest("login.skype.com/login")
{
+ //flags = NLHRF_SSL | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT;
Url
<< INT_VALUE("client_id", 578134)
<< CHAR_VALUE("redirect_uri", "https%3A%2F%2Fweb.skype.com");
Headers
<< CHAR_VALUE("Host", "login.skype.com")
- << CHAR_VALUE("Referer", "https://login.skype.com/login?method=skype&client_id=578134&redirect_uri=https%3A%2F%2Fweb.skype.com");
+ << CHAR_VALUE("Referer", "https://login.skype.com/login?method=skype&client_id=578134&redirect_uri=https%3A%2F%2Fweb.skype.com")
+ << CHAR_VALUE("Connection", "keep-alive");
LPTIME_ZONE_INFORMATION tzi = tmi.getTziByContact(NULL);
char sign = tzi->Bias > 0 ? '-' : '+';
diff --git a/protocols/SkypeWeb/src/requests/reg_info.h b/protocols/SkypeWeb/src/requests/reg_info.h
index 6ba0518524..888ce987b0 100644
--- a/protocols/SkypeWeb/src/requests/reg_info.h
+++ b/protocols/SkypeWeb/src/requests/reg_info.h
@@ -7,10 +7,12 @@ public:
GetRegInfoRequest(const char *token) :
HttpsPostRequest("client-s.gateway.messenger.live.com/v1/users/ME/endpoints")
{
- Headers
+ CMStringA auth = "skypetoken=";
+ auth += token;
+ Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
- << FORMAT_VALUE("Authentication", "skypetoken=%s", token)
+ << CHAR_VALUE("Authentication", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset = UTF-8")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
<< CHAR_VALUE("Origin", "https://web.skype.com")
diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h
index 07703e84ae..a8c40a492b 100644
--- a/protocols/SkypeWeb/src/requests/status.h
+++ b/protocols/SkypeWeb/src/requests/status.h
@@ -7,10 +7,12 @@ public:
SetStatusRequest(const char *regToken, bool status) :
HttpsRequest(REQUEST_PUT, "client-s.gateway.messenger.live.com/v1/users/ME/presenceDocs/messagingService")
{
+ CMStringA auth = "registrationToken=";
+ auth += regToken;
Headers
<< CHAR_VALUE("Accept", "application / json, text / javascript")
<< CHAR_VALUE("Expires", "0")
- << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
+ << CHAR_VALUE("RegistrationToken", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset = UTF-8")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
<< CHAR_VALUE("Origin", "https://web.skype.com")