diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-19 10:44:40 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-19 10:44:40 +0000 |
commit | 828d3d3cc4244db17bd56a8ed6122cc8ebc11fd2 (patch) | |
tree | 95e4e66df17a5cd102155e08a6e9a3505fc2c5b7 /protocols/SkypeWeb/src/requests | |
parent | 75d49b8c135872953af2aa706916e5e2117efd64 (diff) |
SkypeWeb: Chats supprt part 3.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r-- | protocols/SkypeWeb/src/requests/chatrooms.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index 2a41798c50..088c096040 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -18,6 +18,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #ifndef _SKYPE_REQUEST_CHATS_H_
#define _SKYPE_REQUEST_CHATS_H_
+class SendChatMessageRequest : public HttpRequest
+{
+public:
+ SendChatMessageRequest(const char *regToken, const char *username, 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, username)
+ {
+ 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));
+
+ ptrA data(mir_utf8encodeT(ptrT(json_write(node))));
+ Body << VALUE(data);
+
+ json_delete(node);
+ }
+};
+
class CreateChatroomRequest : public HttpRequest
{
public:
|