diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-29 14:53:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-29 14:53:33 +0000 |
commit | 2fcca210a1f695d7a932b873ae00dc702d42cfeb (patch) | |
tree | 2f06ee3f54a5d7cd6f479497cfd2111c2f5afffa /protocols/SkypeWeb/src/requests/capabilities.h | |
parent | 72e13eb85e4b7aaf0ba82a2de750e1eee454bd6b (diff) |
SkypeWeb to use new json parser
git-svn-id: http://svn.miranda-ng.org/main/trunk@13891 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests/capabilities.h')
-rw-r--r-- | protocols/SkypeWeb/src/requests/capabilities.h | 54 |
1 files changed, 23 insertions, 31 deletions
diff --git a/protocols/SkypeWeb/src/requests/capabilities.h b/protocols/SkypeWeb/src/requests/capabilities.h index fb7c668c20..ef0da77f92 100644 --- a/protocols/SkypeWeb/src/requests/capabilities.h +++ b/protocols/SkypeWeb/src/requests/capabilities.h @@ -30,38 +30,30 @@ public: << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken);
- char compName[MAX_COMPUTERNAME_LENGTH + 1];
+ TCHAR compName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = SIZEOF(compName);
- GetComputerNameA(compName, &size);
-
- JSONNODE *node = json_new(5);
- JSONNODE *privateInfo = json_new(5);
- JSONNODE *publicInfo = json_new(5);
-
- json_set_name(privateInfo, "privateInfo");
- json_set_name(publicInfo, "publicInfo");
-
- json_push_back(node, json_new_a("id", "messagingService"));
- json_push_back(node, json_new_a("type", "EndpointPresenceDoc"));
- json_push_back(node, json_new_a("selfLink", "uri"));
-
- json_push_back(privateInfo, json_new_a("epname", compName));
-
- json_push_back(publicInfo, json_new_a("capabilities", "Audio|Video"));
- json_push_back(publicInfo, json_new_i("typ", 125));
- json_push_back(publicInfo, json_new_a("skypeNameVersion", "Miranda NG Skype"));
- json_push_back(publicInfo, json_new_a("nodeInfo", "xx"));
- json_push_back(publicInfo, json_new_a("version", g_szMirVer));
-
- json_push_back(node, privateInfo);
- json_push_back(node, publicInfo);
-
- ptrA data(mir_utf8encodeT(ptrT(json_write(node))));
-
- Body <<
- VALUE(data);
-
- json_delete(node);
+ GetComputerName(compName, &size);
+
+ JSONNode privateInfo(JSON_NODE);
+ privateInfo.set_name("privateInfo");
+ privateInfo.push_back(JSONNode("epname", T2Utf(compName)));
+
+ JSONNode publicInfo(JSON_NODE);
+ publicInfo.set_name("publicInfo");
+ publicInfo.push_back(JSONNode("capabilities", "Audio|Video"));
+ publicInfo.push_back(JSONNode("typ", 125));
+ publicInfo.push_back(JSONNode("skypeNameVersion", "Miranda NG Skype"));
+ publicInfo.push_back(JSONNode("nodeInfo", "xx"));
+ publicInfo.push_back(JSONNode("version", g_szMirVer));
+
+ JSONNode node(JSON_NODE);
+ node.push_back(JSONNode("id", "messagingService"));
+ node.push_back(JSONNode("type", "EndpointPresenceDoc"));
+ node.push_back(JSONNode("selfLink", "uri"));
+ node.push_back(privateInfo);
+ node.push_back(publicInfo);
+
+ Body << VALUE(node.write().c_str());
}
};
#endif //_SKYPE_REQUEST_CAPS_H_
\ No newline at end of file |