diff options
Diffstat (limited to 'protocols/SkypeWeb/src/requests/subscriptions.h')
-rw-r--r-- | protocols/SkypeWeb/src/requests/subscriptions.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h index b29eddc639..403f7368e9 100644 --- a/protocols/SkypeWeb/src/requests/subscriptions.h +++ b/protocols/SkypeWeb/src/requests/subscriptions.h @@ -29,17 +29,18 @@ public: << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8");
- JSONNode interestedResources(JSON_ARRAY);
- interestedResources.set_name("interestedResources");
- interestedResources.push_back(JSONNode("", "/v1/users/ME/conversations/ALL/properties"));
- interestedResources.push_back(JSONNode("", "/v1/users/ME/conversations/ALL/messages"));
- interestedResources.push_back(JSONNode("", "/v1/users/ME/contacts/ALL"));
- interestedResources.push_back(JSONNode("", "/v1/threads/ALL"));
+ JSONNode interestedResources(JSON_ARRAY); interestedResources.set_name("interestedResources");
+ interestedResources
+ << JSONNode("", "/v1/users/ME/conversations/ALL/properties")
+ << JSONNode("", "/v1/users/ME/conversations/ALL/messages")
+ << JSONNode("", "/v1/users/ME/contacts/ALL")
+ << JSONNode("", "/v1/threads/ALL");
- JSONNode node(JSON_NODE);
- node.push_back(JSONNode("channelType", "httpLongPoll"));
- node.push_back(JSONNode("template", "raw"));
- node.push_back(interestedResources);
+ JSONNode node;
+ node
+ << JSONNode("channelType", "httpLongPoll")
+ << JSONNode("template", "raw")
+ << interestedResources;
Body << VALUE(node.write().c_str());
}
@@ -57,18 +58,16 @@ public: << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken);
- JSONNode node(JSON_NODE);
- JSONNode contacts(JSON_ARRAY);
-
- contacts.set_name("contacts");
+ JSONNode node;
+ JSONNode contacts(JSON_ARRAY); contacts.set_name("contacts");
for (int i = 0; i < skypenames.getCount(); i++)
{
- JSONNode contact(JSON_NODE);
- contact.push_back(JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]).GetBuffer()));
- contacts.push_back(contact);
+ JSONNode contact;
+ contact << JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]));
+ contacts << contact;
}
- node.push_back(contacts);
+ node << contacts;
Body << VALUE(node.write().c_str());
}
|