summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests/chatrooms.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/requests/chatrooms.h')
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h
index 49a3ef9892..8ef23481ce 100644
--- a/protocols/SkypeWeb/src/requests/chatrooms.h
+++ b/protocols/SkypeWeb/src/requests/chatrooms.h
@@ -42,6 +42,31 @@ public:
}
};
+class SendChatActionRequest : public HttpRequest
+{
+public:
+ SendChatActionRequest(const char *regToken, const char *id, time_t timestamp, const char *message, const char *server = SKYPE_ENDPOINTS_HOST) :
+ HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/conversations/19:%s/messages", server, id)
+ {
+ Headers
+ << CHAR_VALUE("Accept", "application/json, text/javascript")
+ << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
+ << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8");
+
+ JSONNODE *node = json_new(5);
+ json_push_back(node, json_new_i("clientmessageid", timestamp));
+ json_push_back(node, json_new_a("messagetype", "RichText"));
+ json_push_back(node, json_new_a("contenttype", "text"));
+ json_push_back(node, json_new_a("content", message));
+ json_push_back(node, json_new_i("skypeemoteoffset", 4));
+
+ ptrA data(mir_utf8encodeT(ptrT(json_write(node))));
+ Body << VALUE(data);
+
+ json_delete(node);
+ }
+};
+
class CreateChatroomRequest : public HttpRequest
{
public: