summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r--protocols/SkypeWeb/src/requests/contacts.h20
-rw-r--r--protocols/SkypeWeb/src/requests/endpoint.h9
-rw-r--r--protocols/SkypeWeb/src/requests/login.h8
-rw-r--r--protocols/SkypeWeb/src/requests/logout.h5
-rw-r--r--protocols/SkypeWeb/src/requests/messages.h8
-rw-r--r--protocols/SkypeWeb/src/requests/poll.h13
-rw-r--r--protocols/SkypeWeb/src/requests/profile.h4
-rw-r--r--protocols/SkypeWeb/src/requests/reg_info.h10
-rw-r--r--protocols/SkypeWeb/src/requests/status.h41
-rw-r--r--protocols/SkypeWeb/src/requests/subscriptions.h12
10 files changed, 44 insertions, 86 deletions
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h
index 55d35334ae..786f59e10d 100644
--- a/protocols/SkypeWeb/src/requests/contacts.h
+++ b/protocols/SkypeWeb/src/requests/contacts.h
@@ -1,11 +1,11 @@
#ifndef _SKYPE_REQUEST_CONTACTS_H_
#define _SKYPE_REQUEST_CONTACTS_H_
-class GetContactListRequest : public HttpsGetRequest
+class GetContactListRequest : public HttpRequest
{
public:
GetContactListRequest(const char *token, const char *skypename = "self") :
- HttpsGetRequest("api.skype.com/users/%s/contacts", skypename)
+ HttpRequest(REQUEST_GET, FORMAT, "api.skype.com/users/%s/contacts", skypename)
{
Url << CHAR_VALUE("hideDetails", "true");
@@ -15,11 +15,11 @@ public:
}
};
-class GetContactsInfoRequest : public HttpsPostRequest
+class GetContactsInfoRequest : public HttpRequest
{
public:
GetContactsInfoRequest(const char *token, const LIST<char> &skypenames, const char *skypename = "self") :
- HttpsPostRequest("api.skype.com/users/%s/contacts/profiles", skypename)
+ HttpRequest(REQUEST_POST, FORMAT, "api.skype.com/users/%s/contacts/profiles", skypename)
{
Headers
<< CHAR_VALUE("X-Skypetoken", token)
@@ -32,11 +32,11 @@ public:
}
};
-class GetContactsAuthRequest : public HttpsGetRequest
+class GetContactsAuthRequest : public HttpRequest
{
public:
GetContactsAuthRequest(const char *token, const char *skypename = "self") :
- HttpsGetRequest("api.skype.com/users/%s/contacts/auth-request", skypename)
+ HttpRequest(REQUEST_GET, FORMAT, "api.skype.com/users/%s/contacts/auth-request", skypename)
{
Headers
<< CHAR_VALUE("X-Skypetoken", token)
@@ -44,11 +44,11 @@ public:
}
};
-class AuthAcceptRequest : public HttpsGetRequest
+class AuthAcceptRequest : public HttpRequest
{
public:
AuthAcceptRequest(const char *token, const char *who, const char *skypename = "self") :
- HttpsGetRequest("api.skype.com/users/%s/contacts/auth-request/%s/accept", skypename, who)
+ HttpRequest(REQUEST_GET, FORMAT, "api.skype.com/users/%s/contacts/auth-request/%s/accept", skypename, who)
{
Headers
<< CHAR_VALUE("X-Skypetoken", token)
@@ -56,11 +56,11 @@ public:
}
};
-class AuthDeclineRequest : public HttpsGetRequest
+class AuthDeclineRequest : public HttpRequest
{
public:
AuthDeclineRequest(const char *token, const char *who, const char *skypename = "self") :
- HttpsGetRequest("api.skype.com/users/%s/contacts/auth-request/%s/decline", skypename)
+ HttpRequest(REQUEST_GET, FORMAT, "api.skype.com/users/%s/contacts/auth-request/%s/decline", skypename)
{
Headers
<< CHAR_VALUE("X-Skypetoken", token)
diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h
index bc3bdaff32..f6dd9c604c 100644
--- a/protocols/SkypeWeb/src/requests/endpoint.h
+++ b/protocols/SkypeWeb/src/requests/endpoint.h
@@ -1,19 +1,16 @@
#ifndef _SKYPE_REQUEST_ENDPOINT_H_
#define _SKYPE_REQUEST_ENDPOINT_H_
-class GetEndpointRequest : public HttpsRequest
+class GetEndpointRequest : public HttpRequest
{
public:
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))
+ HttpRequest(REQUEST_PUT, FORMAT, "client-s.gateway.messenger.live.com/v1/users/ME/endpoints/%s/presenceDocs/messagingService", ptrA(mir_urlEncode(endpointID)))
{
- flags |= NLHRF_SSL;
- CMStringA auth = "registrationToken=";
- auth += regToken;
Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
- << CHAR_VALUE("RegistrationToken", auth)
+ << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
<< CHAR_VALUE("BehaviorOverride", "redirectAs404")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
diff --git a/protocols/SkypeWeb/src/requests/login.h b/protocols/SkypeWeb/src/requests/login.h
index c7924a842c..54af48f211 100644
--- a/protocols/SkypeWeb/src/requests/login.h
+++ b/protocols/SkypeWeb/src/requests/login.h
@@ -1,13 +1,14 @@
#ifndef _SKYPE_REQUEST_LOGIN_H_
#define _SKYPE_REQUEST_LOGIN_H_
-class LoginRequest : public HttpsPostRequest
+class LoginRequest : public HttpRequest
{
public:
LoginRequest() :
- HttpsPostRequest("login.skype.com/login")
+ HttpRequest(REQUEST_POST, "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");
@@ -18,9 +19,10 @@ public:
}
LoginRequest(const char *skypename, const char *password, const char *pie, const char *etm) :
- HttpsPostRequest("login.skype.com/login")
+ HttpRequest(REQUEST_POST, "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");
diff --git a/protocols/SkypeWeb/src/requests/logout.h b/protocols/SkypeWeb/src/requests/logout.h
index 57caff2239..989a36776e 100644
--- a/protocols/SkypeWeb/src/requests/logout.h
+++ b/protocols/SkypeWeb/src/requests/logout.h
@@ -1,12 +1,11 @@
#ifndef _SKYPE_REQUEST_LOGOUT_H_
#define _SKYPE_REQUEST_LOGOUT_H_
-class LogoutRequest : public HttpsGetRequest
+class LogoutRequest : public HttpRequest
{
public:
- LogoutRequest() : HttpsGetRequest("login.skype.com/logout")
+ LogoutRequest() : HttpRequest(REQUEST_GET, "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");
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h
index a61441e10a..e86f54fce9 100644
--- a/protocols/SkypeWeb/src/requests/messages.h
+++ b/protocols/SkypeWeb/src/requests/messages.h
@@ -1,18 +1,16 @@
#ifndef _SKYPE_REQUEST_MESSAGES_H_
#define _SKYPE_REQUEST_MESSAGES_H_
-class SendMsgRequest : public HttpsPostRequest
+class SendMsgRequest : public HttpRequest
{
public:
SendMsgRequest(const char *regToken, const char *username, const char *message) :
- HttpsPostRequest("client-s.gateway.messenger.live.com/v1/users/ME/conversations/8:%s/messages", username)
+ HttpRequest(REQUEST_POST, FORMAT, "client-s.gateway.messenger.live.com/v1/users/ME/conversations/8:%s/messages", username)
{
- CMStringA auth = "registrationToken=";
- auth += regToken;
Headers
<< CHAR_VALUE("Accept", "application / json, text / javascript")
<< CHAR_VALUE("Expires", "0")
- << CHAR_VALUE("RegistrationToken", auth)
+ << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< CHAR_VALUE("Content-Type", "application/json; charset = UTF-8")
<< CHAR_VALUE("BehaviorOverride", "redirectAs404")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
diff --git a/protocols/SkypeWeb/src/requests/poll.h b/protocols/SkypeWeb/src/requests/poll.h
index edec20dec7..48108ccdbc 100644
--- a/protocols/SkypeWeb/src/requests/poll.h
+++ b/protocols/SkypeWeb/src/requests/poll.h
@@ -1,22 +1,19 @@
#ifndef _SKYPE_POLL_H_
#define _SKYPE_POLL_H_
-class PollRequest : public HttpsPostRequest
+class PollRequest : public HttpRequest
{
public:
PollRequest(const char *regToken) :
- HttpsPostRequest("client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions/0/poll")
+ HttpRequest(REQUEST_POST, "client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions/0/poll")
{
- timeout = 30 * 1000;
- flags |= NLHRF_PERSISTENT;
- CMStringA data;
- CMStringA auth = "registrationToken=";
- auth += regToken;
+ //timeout = 30 * 1000;
+ //flags |= NLHRF_PERSISTENT;
Headers
<< CHAR_VALUE("Connection", "keep-alive")
<< CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
- << CHAR_VALUE("RegistrationToken", auth)
+ << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
<< CHAR_VALUE("BehaviorOverride", "redirectAs404")
<< CHAR_VALUE("Referer", "https://web.skype.com/main")
diff --git a/protocols/SkypeWeb/src/requests/profile.h b/protocols/SkypeWeb/src/requests/profile.h
index 579ac446b4..e7d7a4b682 100644
--- a/protocols/SkypeWeb/src/requests/profile.h
+++ b/protocols/SkypeWeb/src/requests/profile.h
@@ -1,11 +1,11 @@
#ifndef _SKYPE_REQUEST_PROFILE_H_
#define _SKYPE_REQUEST_PROFILE_H_
-class GetProfileRequest : public HttpsGetRequest
+class GetProfileRequest : public HttpRequest
{
public:
GetProfileRequest(const char *token, const char *skypename = "self") :
- HttpsGetRequest("api.skype.com/users/%s/profile", skypename)
+ HttpRequest(REQUEST_GET, FORMAT, "api.skype.com/users/%s/profile", skypename)
{
Headers
<< CHAR_VALUE("X-Skypetoken", token)
diff --git a/protocols/SkypeWeb/src/requests/reg_info.h b/protocols/SkypeWeb/src/requests/reg_info.h
index 888ce987b0..47f649ec61 100644
--- a/protocols/SkypeWeb/src/requests/reg_info.h
+++ b/protocols/SkypeWeb/src/requests/reg_info.h
@@ -1,18 +1,16 @@
#ifndef _SKYPE_REQUEST_REGINFO_H_
#define _SKYPE_REQUEST_REGINFO_H_
-class GetRegInfoRequest : public HttpsPostRequest
+class GetRegInfoRequest : public HttpRequest
{
public:
GetRegInfoRequest(const char *token) :
- HttpsPostRequest("client-s.gateway.messenger.live.com/v1/users/ME/endpoints")
+ HttpRequest(REQUEST_POST, "client-s.gateway.messenger.live.com/v1/users/ME/endpoints")
{
- CMStringA auth = "skypetoken=";
- auth += token;
- Headers
+ Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
- << CHAR_VALUE("Authentication", auth)
+ << FORMAT_VALUE("Authentication", "skypetoken=%s", token)
<< 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 2f0f9f4f42..1fc30bac81 100644
--- a/protocols/SkypeWeb/src/requests/status.h
+++ b/protocols/SkypeWeb/src/requests/status.h
@@ -1,16 +1,16 @@
#ifndef _SKYPE_REQUEST_STATUS_H_
#define _SKYPE_REQUEST_STATUS_H_
-class SetStatusRequest : public HttpsRequest
+class SetStatusRequest : public HttpRequest
{
public:
- SetStatusRequest(const char *regToken, int status) :
- HttpsRequest(REQUEST_PUT, "client-s.gateway.messenger.live.com/v1/users/ME/presenceDocs/messagingService")
+ SetStatusRequest(const char *regToken, const char *status) :
+ HttpRequest(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("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
<< CHAR_VALUE("RegistrationToken", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset = UTF-8")
@@ -19,38 +19,7 @@ public:
<< CHAR_VALUE("Origin", "https://web.skype.com")
<< CHAR_VALUE("Connection", "keep-alive");
- const char *data;
- 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);
+ Body << FORMAT_VALUE("{\"status\":\"%s\"}", status);
}
};
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h
index 609d5cfec3..624c7685a4 100644
--- a/protocols/SkypeWeb/src/requests/subscriptions.h
+++ b/protocols/SkypeWeb/src/requests/subscriptions.h
@@ -1,26 +1,24 @@
#ifndef _SKYPE_REQUEST_SUBSCIPTIONS_H_
#define _SKYPE_REQUEST_SUBSCIPTIONS_H_
-class SubscriptionsRequest : public HttpsPostRequest
+class SubscriptionsRequest : public HttpRequest
{
public:
SubscriptionsRequest(const char *regToken) :
- HttpsPostRequest("client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions")
+ HttpRequest(REQUEST_POST, "client-s.gateway.messenger.live.com/v1/users/ME/endpoints/SELF/subscriptions")
{
- CMStringA auth = "registrationToken=";
- auth += regToken;
Headers
<< CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
- << CHAR_VALUE("RegistrationToken", auth)
+ << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< 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 = "{\"channelType\":\"httpLongPoll\",\"template\":\"raw\",\"interestedResources\":[\"/v1/users/ME/conversations/ALL/properties\",\"/v1/users/ME/conversations/ALL/messages\",\"/v1/users/ME/contacts/ALL\",\"/v1/threads/ALL\"]}";
- Body << VALUE(data);
+ const char *data = "{\"channelType\":\"httpLongPoll\",\"template\":\"raw\",\"interestedResources\":[\"/v1/users/ME/conversations/ALL/properties\",\"/v1/users/ME/conversations/ALL/messages\",\"/v1/users/ME/contacts/ALL\",\"/v1/threads/ALL\"]}";
+ Body << VALUE(data);
}
};