summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests/chatrooms.h
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-06-02 12:19:12 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-06-02 12:19:12 +0000
commitcb9f90e85032559d2da6e3b40a05352365e6d90f (patch)
tree6c0ddd2ae33a3a9e92324d406cf696e2b4202bc0 /protocols/SkypeWeb/src/requests/chatrooms.h
parent28284465a2ff445c029849b73fb589429698b525 (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/chatrooms.h')
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h25
1 files changed, 18 insertions, 7 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h
index 905f6afd47..b78053f7f1 100644
--- a/protocols/SkypeWeb/src/requests/chatrooms.h
+++ b/protocols/SkypeWeb/src/requests/chatrooms.h
@@ -93,13 +93,21 @@ public:
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
<< FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken);
- CMStringA data = "{\"members\":[";
+ JSONNode node(JSON_NODE);
+ JSONNode members(JSON_ARRAY);
+
+ members.set_name("members");
+
for (int i = 0; i < skypenames.getCount(); i++)
- data.AppendFormat("{\"id\":\"8:%s\",\"role\":\"%s\"},", skypenames[i], !mir_strcmpi(skypenames[i], selfname) ? "Admin" : "User");
- data.Truncate(data.GetLength() - 1);
- data.Append("]}");
+ {
+ JSONNode member(JSON_NODE);
+ member.push_back(JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]).GetBuffer()));
+ member.push_back(JSONNode("role", !mir_strcmpi(skypenames[i], selfname) ? "Admin" : "User"));
+ members.push_back(member);
+ }
+ node.push_back(members);
- Body << VALUE(data);
+ Body << VALUE(node.write().c_str());
}
};
@@ -129,8 +137,11 @@ public:
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
<< FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken);
- CMStringA data(::FORMAT, "{\"role\":\"%s\"}", role);
- Body << VALUE(data);
+ JSONNode node(JSON_NODE);
+
+ node.push_back(JSONNode("role", role));
+
+ Body << VALUE(node.write().c_str());
}
};