summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests/subscriptions.h
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-05-07 15:58:59 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-05-07 15:58:59 +0000
commitaa6b13e2545e7b8dbab49bc14909443643e375e9 (patch)
treedf88fb1a7bcc79f1fa78ae9dd2d8ed734026088b /protocols/SkypeWeb/src/requests/subscriptions.h
parentfb2739625f4424488433e4edc53082e452e610fa (diff)
SkypeWeb: Manual JSON formation removed. Other fixes. Version bump.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13475 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests/subscriptions.h')
-rw-r--r--protocols/SkypeWeb/src/requests/subscriptions.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h
index 2490329140..d0f8c60460 100644
--- a/protocols/SkypeWeb/src/requests/subscriptions.h
+++ b/protocols/SkypeWeb/src/requests/subscriptions.h
@@ -28,9 +28,25 @@ public:
<< 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);
+ JSONNODE *interestedResources = json_new(4);
+ json_set_name(interestedResources, "interestedResources");
- 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\"]}";
+ json_push_back(node, json_new_a("channelType", "httpLongPoll"));
+ json_push_back(node, json_new_a("template", "raw" ));
+
+ json_push_back(interestedResources, json_new_a(NULL, "/v1/users/ME/conversations/ALL/properties"));
+ json_push_back(interestedResources, json_new_a(NULL, "/v1/users/ME/conversations/ALL/messages"));
+ json_push_back(interestedResources, json_new_a(NULL, "/v1/users/ME/contacts/ALL"));
+ json_push_back(interestedResources, json_new_a(NULL, "/v1/threads/ALL"));
+ json_push_back(node, interestedResources);
+
+ ptrA data(mir_utf8encodeT(ptrT(json_write(node))));
+
Body << VALUE(data);
+
+ json_delete(node);
}
};