diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-02 12:19:12 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-06-02 12:19:12 +0000 |
commit | cb9f90e85032559d2da6e3b40a05352365e6d90f (patch) | |
tree | 6c0ddd2ae33a3a9e92324d406cf696e2b4202bc0 /protocols/SkypeWeb/src/requests/subscriptions.h | |
parent | 28284465a2ff445c029849b73fb589429698b525 (diff) |
SkypeWeb: Manual json formatting removed. Fix avatar cache for "facebook" contacts. Other fixes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13971 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests/subscriptions.h')
-rw-r--r-- | protocols/SkypeWeb/src/requests/subscriptions.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h index 7c46df3f35..b29eddc639 100644 --- a/protocols/SkypeWeb/src/requests/subscriptions.h +++ b/protocols/SkypeWeb/src/requests/subscriptions.h @@ -56,13 +56,21 @@ public: << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
<< FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken);
- CMStringA data = "{\"contacts\":[";
+
+ JSONNode node(JSON_NODE);
+ JSONNode contacts(JSON_ARRAY);
+
+ contacts.set_name("contacts");
+
for (int i = 0; i < skypenames.getCount(); i++)
- data.AppendFormat("{\"id\":\"8:%s\"},", skypenames[i]);
- data.Truncate(data.GetLength() - 1);
- data.Append("]}");
+ {
+ JSONNode contact(JSON_NODE);
+ contact.push_back(JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]).GetBuffer()));
+ contacts.push_back(contact);
+ }
+ node.push_back(contacts);
- Body << VALUE(data);
+ Body << VALUE(node.write().c_str());
}
};
|