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/endpoint.h2
-rw-r--r--protocols/SkypeWeb/src/requests/logout.h4
-rw-r--r--protocols/SkypeWeb/src/requests/messages.h26
-rw-r--r--protocols/SkypeWeb/src/requests/poll.h27
-rw-r--r--protocols/SkypeWeb/src/requests/subscriptions.h27
5 files changed, 83 insertions, 3 deletions
diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h
index d6e0fdda7c..bc3bdaff32 100644
--- a/protocols/SkypeWeb/src/requests/endpoint.h
+++ b/protocols/SkypeWeb/src/requests/endpoint.h
@@ -21,7 +21,7 @@ public:
<< CHAR_VALUE("Connection", "keep-alive");
Body <<
- VALUE("{\"id\":\"messagingService\",\"type\":\"EndpointPresenceDoc\",\"selfLink\":\"uri\",\"privateInfo\":{\"epname\":\"skype\"},\"publicInfo\":{\"capabilities\":\"video | audio\",\"type\":1,\"skypeNameVersion\":\"908 / 1.0.30 / swx - skype.com\",\"nodeInfo\":\"xx\",\"version\":\"908 / 1.0.30\"}}");
+ VALUE("{\"id\":\"messagingService\",\"type\":\"EndpointPresenceDoc\",\"selfLink\":\"uri\",\"privateInfo\":{\"epname\":\"Miranda\"},\"publicInfo\":{\"capabilities\":\"\",\"type\":1,\"skypeNameVersion\":\"0/0.95.4//\",\"nodeInfo\":\"xx\",\"version\":\"0/0.95.4\"}}");
}
};
#endif //_SKYPE_REQUEST_ENDPOINT_H_ \ No newline at end of file
diff --git a/protocols/SkypeWeb/src/requests/logout.h b/protocols/SkypeWeb/src/requests/logout.h
index 2083973e7c..57caff2239 100644
--- a/protocols/SkypeWeb/src/requests/logout.h
+++ b/protocols/SkypeWeb/src/requests/logout.h
@@ -1,10 +1,10 @@
#ifndef _SKYPE_REQUEST_LOGOUT_H_
#define _SKYPE_REQUEST_LOGOUT_H_
-class LogoutRequest : public HttpsPostRequest
+class LogoutRequest : public HttpsGetRequest
{
public:
- LogoutRequest() : HttpsPostRequest("login.skype.com/logout")
+ LogoutRequest() : HttpsGetRequest("login.skype.com/logout")
{
//flags = NLHRF_SSL | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT;
Url
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h
new file mode 100644
index 0000000000..a61441e10a
--- /dev/null
+++ b/protocols/SkypeWeb/src/requests/messages.h
@@ -0,0 +1,26 @@
+#ifndef _SKYPE_REQUEST_MESSAGES_H_
+#define _SKYPE_REQUEST_MESSAGES_H_
+
+class SendMsgRequest : public HttpsPostRequest
+{
+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)
+ {
+ CMStringA auth = "registrationToken=";
+ auth += regToken;
+ Headers
+ << CHAR_VALUE("Accept", "application / json, text / javascript")
+ << 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");
+
+ Body << FORMAT_VALUE("{\"clientmessageid\":\"\",\"content\":\"%s\",\"messagetype\":\"RichText\",\"contenttype\":\"text\"}", message);
+ }
+};
+
+#endif //_SKYPE_REQUEST_MESSAGES_H_
diff --git a/protocols/SkypeWeb/src/requests/poll.h b/protocols/SkypeWeb/src/requests/poll.h
new file mode 100644
index 0000000000..edec20dec7
--- /dev/null
+++ b/protocols/SkypeWeb/src/requests/poll.h
@@ -0,0 +1,27 @@
+#ifndef _SKYPE_POLL_H_
+#define _SKYPE_POLL_H_
+
+class PollRequest : public HttpsPostRequest
+{
+public:
+ PollRequest(const char *regToken) :
+ HttpsPostRequest("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;
+ Headers
+ << CHAR_VALUE("Connection", "keep-alive")
+ << CHAR_VALUE("Accept", "application/json, text/javascript")
+ << 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");
+ }
+};
+#endif //_SKYPE_POLL_H_ \ No newline at end of file
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h
new file mode 100644
index 0000000000..609d5cfec3
--- /dev/null
+++ b/protocols/SkypeWeb/src/requests/subscriptions.h
@@ -0,0 +1,27 @@
+#ifndef _SKYPE_REQUEST_SUBSCIPTIONS_H_
+#define _SKYPE_REQUEST_SUBSCIPTIONS_H_
+
+class SubscriptionsRequest : public HttpsPostRequest
+{
+public:
+ SubscriptionsRequest(const char *regToken) :
+ HttpsPostRequest("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)
+ << 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);
+ }
+};
+
+#endif //_SKYPE_REQUEST_SUBSCIPTIONS_H_