diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-03 05:33:18 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-03 05:33:18 +0000 |
commit | a50ae784ce7394b2621cf42a28cab7edd31e6c6a (patch) | |
tree | d32d2925947e77442d364c1849adfd54bb896276 /protocols/SkypeWeb/src/requests/messages.h | |
parent | 2e511ab1b1ff3d78c695874e3b28ff4ce7680cc8 (diff) |
login fix and some other fixes (patch by MikalaiR)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12581 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests/messages.h')
-rw-r--r-- | protocols/SkypeWeb/src/requests/messages.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h index e86f54fce9..ecd939bbd0 100644 --- a/protocols/SkypeWeb/src/requests/messages.h +++ b/protocols/SkypeWeb/src/requests/messages.h @@ -4,8 +4,8 @@ class SendMsgRequest : public HttpRequest
{
public:
- SendMsgRequest(const char *regToken, const char *username, const char *message) :
- HttpRequest(REQUEST_POST, FORMAT, "client-s.gateway.messenger.live.com/v1/users/ME/conversations/8:%s/messages", username)
+ SendMsgRequest(const char *regToken, const char *username, const char *message, const char *server = "client-s.gateway.messenger.live.com") :
+ HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages", server, username)
{
Headers
<< CHAR_VALUE("Accept", "application / json, text / javascript")
@@ -21,4 +21,29 @@ public: }
};
+class SendTypingRequest : public HttpRequest
+{
+public:
+ SendTypingRequest(const char *regToken, const char *username,bool bstate, const char *server = "client-s.gateway.messenger.live.com") :
+ HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages", server, mir_urlEncode(username))
+ {
+ Headers
+ << CHAR_VALUE("Accept", "application / json, text / javascript")
+ << CHAR_VALUE("Expires", "0")
+ << 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");
+ CMStringA state;
+ if (bstate) state = "Control/Typing";
+ else state = "Control/ClearTyping";
+ CMStringA data;
+ data.AppendFormat("{\"clienmessageid\":%d, \"content\":\"\", \"messagetype\":\"%s\", \"contenttype\":\"text\"}", time(NULL), state);
+
+ Body << VALUE(data);
+ }
+};
+
#endif //_SKYPE_REQUEST_MESSAGES_H_
|