diff options
Diffstat (limited to 'protocols/ICQ-WIM/src/http.cpp')
-rw-r--r-- | protocols/ICQ-WIM/src/http.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/protocols/ICQ-WIM/src/http.cpp b/protocols/ICQ-WIM/src/http.cpp index 16c410c333..7e262d659d 100644 --- a/protocols/ICQ-WIM/src/http.cpp +++ b/protocols/ICQ-WIM/src/http.cpp @@ -265,6 +265,34 @@ JsonReply::~JsonReply() ///////////////////////////////////////////////////////////////////////////////////////// +FileReply::FileReply(NETLIBHTTPREQUEST *pReply) +{ + if (pReply == nullptr) { + m_errorCode = 500; + return; + } + + m_errorCode = pReply->resultCode; + if (m_errorCode != 200) + return; + + m_root = json_parse(pReply->pData); + if (m_root == nullptr) { + m_errorCode = 500; + return; + } + + m_errorCode = (*m_root)["status"].as_int(); + m_data = &(*m_root)["data"]; +} + +FileReply::~FileReply() +{ + json_delete(m_root); +} + +///////////////////////////////////////////////////////////////////////////////////////// + RobustReply::RobustReply(NETLIBHTTPREQUEST *pReply) { if (pReply == nullptr) { |