diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-29 19:14:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-29 19:14:39 +0300 |
commit | 8d60f01ae16e88730284757f0a062300b63b2b2d (patch) | |
tree | 16b490084d48c8d7a889d2b503ab0421f1c2c825 /protocols/SkypeWeb/src/skype_chatrooms.cpp | |
parent | 1a1474ff783f5e6a3759110bf63ace1d0d53bd83 (diff) |
fixes #2149 (SkypeWeb doesn't parse error codes)
Diffstat (limited to 'protocols/SkypeWeb/src/skype_chatrooms.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index d0577bb99f..3491416078 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -59,10 +59,11 @@ void CSkypeProto::OnLoadChats(const NETLIBHTTPREQUEST *response) if (response == nullptr)
return;
- JSONNode root = JSONNode::parse(response->pData);
- if (!root)
+ JsonReply reply(response);
+ if (reply.error())
return;
+ auto &root = reply.data();
const JSONNode &metadata = root["_metadata"];
const JSONNode &conversations = root["conversations"].as_array();
@@ -369,10 +370,11 @@ void CSkypeProto::OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p) if (response == nullptr || response->pData == nullptr)
return;
- JSONNode root = JSONNode::parse(response->pData);
- if (!root)
+ JsonReply reply(response);
+ if (reply.error())
return;
+ auto &root = reply.data();
const JSONNode &members = root["members"];
const JSONNode &properties = root["properties"];
if (!properties["capabilities"] || properties["capabilities"].empty())
|