diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-03-30 19:23:00 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-03-30 19:23:00 +0000 |
commit | 5c46a4ff3d889e7ef4b2c4a8e6c353f84207a7ab (patch) | |
tree | 30c196f189620d37aca012da4962b0ba16aed6b8 /protocols/SkypeWeb/src/requests | |
parent | 02ac3e7c9a90243ab30c7ea0f780e498262123e1 (diff) |
SkypeWeb: massive improvements (patch from MikalaiR)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12556 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r-- | protocols/SkypeWeb/src/requests/contacts.h | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/endpoint.h | 5 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/logout.h | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/status.h | 39 |
4 files changed, 45 insertions, 13 deletions
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h index 21bf1d56a5..55d35334ae 100644 --- a/protocols/SkypeWeb/src/requests/contacts.h +++ b/protocols/SkypeWeb/src/requests/contacts.h @@ -18,8 +18,8 @@ public: class GetContactsInfoRequest : public HttpsPostRequest
{
public:
- GetContactsInfoRequest(const char *token, const LIST<char> &skypenames/*, const char *skypename = "self"*/) :
- HttpsPostRequest("api.skype.com/users/self/contacts/profiles"/*, skypename*/)
+ GetContactsInfoRequest(const char *token, const LIST<char> &skypenames, const char *skypename = "self") :
+ HttpsPostRequest("api.skype.com/users/%s/contacts/profiles", skypename)
{
Headers
<< CHAR_VALUE("X-Skypetoken", token)
diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h index 3bd6827ac4..d6e0fdda7c 100644 --- a/protocols/SkypeWeb/src/requests/endpoint.h +++ b/protocols/SkypeWeb/src/requests/endpoint.h @@ -4,8 +4,8 @@ class GetEndpointRequest : public HttpsRequest
{
public:
- GetEndpointRequest(const char *regToken, const char *endpointURL) :
- HttpsRequest(REQUEST_PUT, endpointURL)
+ GetEndpointRequest(const char *regToken, const char *endpointID) :
+ HttpsRequest(REQUEST_PUT, "client-s.gateway.messenger.live.com/v1/users/ME/endpoints/%s/presenceDocs/messagingService", mir_urlEncode(endpointID))
{
flags |= NLHRF_SSL;
CMStringA auth = "registrationToken=";
@@ -15,6 +15,7 @@ public: << CHAR_VALUE("Expires", "0")
<< CHAR_VALUE("RegistrationToken", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
+ << CHAR_VALUE("BehaviorOverride", "redirectAs404")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
<< CHAR_VALUE("Origin", "https://web.skype.com")
<< CHAR_VALUE("Connection", "keep-alive");
diff --git a/protocols/SkypeWeb/src/requests/logout.h b/protocols/SkypeWeb/src/requests/logout.h index b1585c9e91..2083973e7c 100644 --- a/protocols/SkypeWeb/src/requests/logout.h +++ b/protocols/SkypeWeb/src/requests/logout.h @@ -4,7 +4,15 @@ class LogoutRequest : public HttpsPostRequest
{
public:
- LogoutRequest() : HttpsPostRequest("login.skype.com/logout") { }
+ LogoutRequest() : HttpsPostRequest("login.skype.com/logout")
+ {
+ //flags = NLHRF_SSL | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT;
+ Url
+ << INT_VALUE("client_id", 578134)
+ << CHAR_VALUE("redirect_uri", "https%3A%2F%2Fweb.skype.com&intsrc=client-_-webapp-_-production-_-go-signin");
+ Headers
+ << CHAR_VALUE("Referer", "https://web.skype.com/");
+ }
};
#endif //_SKYPE_REQUEST_LOGOUT_H_
diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h index f37c936ec4..2f0f9f4f42 100644 --- a/protocols/SkypeWeb/src/requests/status.h +++ b/protocols/SkypeWeb/src/requests/status.h @@ -14,19 +14,42 @@ public: << CHAR_VALUE("Expires", "0")
<< CHAR_VALUE("RegistrationToken", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset = UTF-8")
+ << CHAR_VALUE("BehaviorOverride", "redirectAs404")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
<< CHAR_VALUE("Origin", "https://web.skype.com")
<< CHAR_VALUE("Connection", "keep-alive");
const char *data;
- if (status == ID_STATUS_ONLINE)
- data = "{\"status\":\"Online\"}";
- else if (status == ID_STATUS_INVISIBLE)
- data = "{\"status\":\"Hidden\"}";
- else if (status == ID_STATUS_AWAY)
- data = "{\"status\":\"Away\"}";
- else
- data = "{\"status\":\"Online\"}";
+ switch (status)
+ {
+ case ID_STATUS_ONLINE:
+ {
+ data = "{\"status\":\"Online\"}";
+ break;
+ }
+ case ID_STATUS_AWAY:
+ {
+ data = "{\"status\":\"Away\"}";
+ break;
+ }
+ case ID_STATUS_DND:
+ {
+ data = "{\"status\":\"Busy\"}";
+ break;
+ }
+ case ID_STATUS_IDLE:
+ {
+ data = "{\"status\":\"Idle\"}";
+ break;
+ }
+ case ID_STATUS_INVISIBLE:
+ {
+ data = "{\"status\":\"Hidden\"}";
+ break;
+ }
+ default:
+ data = "{\"status\":\"Online\"}";
+ }
Body << VALUE(data);
}
};
|