diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-07 15:58:59 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-07 15:58:59 +0000 |
commit | aa6b13e2545e7b8dbab49bc14909443643e375e9 (patch) | |
tree | df88fb1a7bcc79f1fa78ae9dd2d8ed734026088b /protocols/SkypeWeb/src/requests/capabilities.h | |
parent | fb2739625f4424488433e4edc53082e452e610fa (diff) |
SkypeWeb: Manual JSON formation removed. Other fixes. Version bump.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13475 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests/capabilities.h')
-rw-r--r-- | protocols/SkypeWeb/src/requests/capabilities.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/requests/capabilities.h b/protocols/SkypeWeb/src/requests/capabilities.h index 35d241adc0..2cf5459b62 100644 --- a/protocols/SkypeWeb/src/requests/capabilities.h +++ b/protocols/SkypeWeb/src/requests/capabilities.h @@ -39,10 +39,36 @@ public: bitness = 64;
#endif
- CMStringA data(::FORMAT, "{\"id\":\"messagingService\",\"type\":\"EndpointPresenceDoc\",\"selfLink\":\"uri\",\"privateInfo\":{\"epname\":\"%s\"},\"publicInfo\":{\"capabilities\":\"Audio|Video\",\"typ\":125,\"skypeNameVersion\":\"Miranda NG Skype\",\"nodeInfo\":\"xx\",\"version\":\"%s x%d\"}}", compName, g_szMirVer, bitness);
+ CMStringA verString(::FORMAT, "%s x%d", g_szMirVer, bitness);
+ 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 ("capabilities", 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", verString.GetBuffer() ));
+
+ json_push_back(node, privateInfo);
+ json_push_back(node, publicInfo);
+
+ ptrA data(mir_utf8encodeT(ptrT(json_write(node))));
+
Body <<
VALUE(data);
+
+ json_delete(node);
}
};
#endif //_SKYPE_REQUEST_CAPS_H_
\ No newline at end of file |