diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-29 18:50:37 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-07-29 18:50:37 +0000 |
commit | 2afddc4305325447f91d879af7d5c4c280257867 (patch) | |
tree | 768293d3378dc33da532e22d9b99e19ca0323680 /protocols/SkypeWeb/src/requests/subscriptions.h | |
parent | 09f41999e99c45c0948d08f474682a85504a48df (diff) |
SkypeWeb: code optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@14754 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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());
}
|