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/skype_login.cpp | |
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/skype_login.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index 4c8462bf65..2f7738ae7c 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -223,12 +223,10 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) if (response == NULL || response->pData == NULL)
return;
- JSONROOT root(response->pData);
- if (root == NULL)
- return;
- ptrA SelfEndpointName(SelfUrlToName(mir_t2a(ptrT(json_as_string(json_get(root, "selfLink"))))));
- setString("SelfEndpointName", SelfEndpointName);
+ JSONNode root = JSONNode::parse(response->pData);
+ if (root)
+ setString("SelfEndpointName", root["selfLink"].as_string().c_str());
}
void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response)
@@ -241,7 +239,7 @@ void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response) return;
}
- JSONROOT json(response->pData);
+ JSONNode json = JSONNode::parse(response->pData);
if (json == NULL)
{
debugLogA(__FUNCTION__ ": failed to change status");
@@ -250,8 +248,7 @@ void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response) return;
}
- ptrT status(json_as_string(json_get(json, "status")));
- int iNewStatus = SkypeToMirandaStatus(_T2A(status));
+ int iNewStatus = SkypeToMirandaStatus(json["status"].as_string().c_str());
if (iNewStatus == ID_STATUS_OFFLINE)
{
debugLogA(__FUNCTION__ ": failed to change status");
@@ -264,4 +261,4 @@ void CSkypeProto::OnStatusChanged(const NETLIBHTTPREQUEST *response) m_iStatus = m_iDesiredStatus = iNewStatus;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_SUCCESS, NULL, 0);
-}
\ No newline at end of file +}
|