summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests/chatrooms.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/requests/chatrooms.h')
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h
index 57e76b2cf2..fa91a712a9 100644
--- a/protocols/SkypeWeb/src/requests/chatrooms.h
+++ b/protocols/SkypeWeb/src/requests/chatrooms.h
@@ -48,16 +48,13 @@ public:
<< FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8");
- JSONNODE *node = json_new(5);
- json_push_back(node, json_new_i("clientmessageid", timestamp));
- json_push_back(node, json_new_a("messagetype", "RichText"));
- json_push_back(node, json_new_a("contenttype", "text"));
- json_push_back(node, json_new_a("content", ptrA(mir_utf8encode(message))));
+ JSONNode node(JSON_NODE);
+ node.push_back(JSONNode("clientmessageid", (long)timestamp));
+ node.push_back(JSONNode("messagetype", "RichText"));
+ node.push_back(JSONNode("contenttype", "text"));
+ node.push_back(JSONNode("content", ptrA(mir_utf8encode(message))));
- T2Utf data(ptrT(json_write(node)));
- Body << VALUE(data);
-
- json_delete(node);
+ Body << VALUE(node.write().c_str());
}
};
@@ -72,17 +69,14 @@ public:
<< FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken)
<< CHAR_VALUE("Content-Type", "application/json; charset=UTF-8");
- JSONNODE *node = json_new(5);
- json_push_back(node, json_new_i("clientmessageid", timestamp));
- json_push_back(node, json_new_a("messagetype", "RichText"));
- json_push_back(node, json_new_a("contenttype", "text"));
- json_push_back(node, json_new_a("content", ptrA(mir_utf8encode(message))));
- json_push_back(node, json_new_i("skypeemoteoffset", 4));
-
- T2Utf data(ptrT(json_write(node)));
- Body << VALUE(data);
+ JSONNode node(JSON_NODE);
+ node.push_back(JSONNode("clientmessageid", (long)timestamp));
+ node.push_back(JSONNode("messagetype", "RichText"));
+ node.push_back(JSONNode("contenttype", "text"));
+ node.push_back(JSONNode("content", ptrA(mir_utf8encode(message))));
+ node.push_back(JSONNode("skypeemoteoffset", 4));
- json_delete(node);
+ Body << VALUE(node.write().c_str());
}
};