summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/http.cpp19
-rw-r--r--protocols/Discord/src/proto.h14
-rw-r--r--protocols/Facebook/src/http.cpp27
-rw-r--r--protocols/Facebook/src/proto.h13
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp27
-rw-r--r--protocols/SkypeWeb/src/skype_utils.h13
-rw-r--r--protocols/Weather/src/stdafx.h17
-rw-r--r--protocols/Weather/src/weather_utils.cpp39
-rw-r--r--protocols/Weather/weather.vcxproj1
-rw-r--r--protocols/Weather/weather.vcxproj.filters3
10 files changed, 0 insertions, 173 deletions
diff --git a/protocols/Discord/src/http.cpp b/protocols/Discord/src/http.cpp
index 32976d39cf..f6a912e9e4 100644
--- a/protocols/Discord/src/http.cpp
+++ b/protocols/Discord/src/http.cpp
@@ -74,25 +74,6 @@ AsyncHttpRequest::AsyncHttpRequest(CDiscordProto *ppro, int iRequestType, LPCSTR
m_iReqNum = ::InterlockedIncrement(&g_reqNum);
}
-JsonReply::JsonReply(MHttpResponse *pReply)
-{
- if (pReply == nullptr) {
- m_errorCode = 500;
- return;
- }
-
- m_errorCode = pReply->resultCode;
-
- m_root = json_parse(pReply->body);
- if (m_root == nullptr)
- m_errorCode = 500;
-}
-
-JsonReply::~JsonReply()
-{
- json_delete(m_root);
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
void CDiscordProto::ServerThread(void*)
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index a147124a43..04fe34110b 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -71,20 +71,6 @@ struct AsyncHttpRequest : public MTHttpRequest<CDiscordProto>
MCONTACT hContact;
};
-class JsonReply
-{
- JSONNode *m_root = nullptr;
- int m_errorCode = 0;
-
-public:
- JsonReply(MHttpResponse *);
- ~JsonReply();
-
- __forceinline int error() const { return m_errorCode; }
- __forceinline JSONNode& data() const { return *m_root; }
- __forceinline operator bool() const { return m_errorCode == 200; }
-};
-
/////////////////////////////////////////////////////////////////////////////////////////
struct CDiscordRole : public MZeroedObject
diff --git a/protocols/Facebook/src/http.cpp b/protocols/Facebook/src/http.cpp
index eaa91d8aff..033fc47b80 100644
--- a/protocols/Facebook/src/http.cpp
+++ b/protocols/Facebook/src/http.cpp
@@ -69,33 +69,6 @@ AsyncHttpRequest* operator<<(AsyncHttpRequest *pReq, const INT_PARAM &param)
/////////////////////////////////////////////////////////////////////////////////////////
-JsonReply::JsonReply(MHttpResponse *pReply)
-{
- if (pReply == nullptr) {
- m_errorCode = 500;
- return;
- }
-
- m_errorCode = pReply->resultCode;
- if (m_errorCode != 200)
- return;
-
- m_root = json_parse(pReply->body);
- if (m_root == nullptr) {
- m_errorCode = 500;
- return;
- }
-
- m_errorCode = (*m_root)["error_code"].as_int();
-}
-
-JsonReply::~JsonReply()
-{
- json_delete(m_root);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
AsyncHttpRequest* FacebookProto::CreateRequest(const char *url, const char *szName, const char *szMethod)
{
AsyncHttpRequest *pReq = new AsyncHttpRequest();
diff --git a/protocols/Facebook/src/proto.h b/protocols/Facebook/src/proto.h
index 00a436b524..87e31351f7 100644
--- a/protocols/Facebook/src/proto.h
+++ b/protocols/Facebook/src/proto.h
@@ -326,19 +326,6 @@ struct AsyncHttpRequest : public MTHttpRequest<FacebookProto>
AsyncHttpRequest *operator<<(AsyncHttpRequest *, const CHAR_PARAM &);
AsyncHttpRequest *operator<<(AsyncHttpRequest *, const INT_PARAM &);
-class JsonReply
-{
- JSONNode *m_root = nullptr;
- int m_errorCode = 0;
-
-public:
- JsonReply(MHttpResponse *);
- ~JsonReply();
-
- __forceinline JSONNode &data() const { return *m_root; }
- __forceinline int error() const { return m_errorCode; }
-};
-
/////////////////////////////////////////////////////////////////////////////////////////
struct FacebookUser
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index 26cf39e7bb..87a0863a4d 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -883,30 +883,3 @@ INT_PTR CSkypeProto::GlobalParseSkypeUriService(WPARAM wParam, LPARAM lParam)
return 1;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-JsonReply::JsonReply(MHttpResponse *pReply)
-{
- if (pReply == nullptr) {
- m_errorCode = 500;
- return;
- }
-
- m_errorCode = pReply->resultCode;
- if (m_errorCode != 200)
- return;
-
- m_root = json_parse(pReply->body);
- if (m_root == nullptr) {
- m_errorCode = 500;
- return;
- }
-
- m_errorCode = (*m_root)["status"]["code"].as_int();
-}
-
-JsonReply::~JsonReply()
-{
- json_delete(m_root);
-}
diff --git a/protocols/SkypeWeb/src/skype_utils.h b/protocols/SkypeWeb/src/skype_utils.h
index 64b72124b3..aecb8f66fe 100644
--- a/protocols/SkypeWeb/src/skype_utils.h
+++ b/protocols/SkypeWeb/src/skype_utils.h
@@ -60,17 +60,4 @@ struct CFileUploadParam : public MZeroedObject
}
};
-class JsonReply
-{
- JSONNode *m_root = nullptr;
- int m_errorCode = 0;
-
-public:
- JsonReply(MHttpResponse *response);
- ~JsonReply();
-
- __forceinline JSONNode &data() const { return *m_root; }
- __forceinline int error() const { return m_errorCode; }
-};
-
#endif //_UTILS_H_
diff --git a/protocols/Weather/src/stdafx.h b/protocols/Weather/src/stdafx.h
index 956ce498b9..96e5410c71 100644
--- a/protocols/Weather/src/stdafx.h
+++ b/protocols/Weather/src/stdafx.h
@@ -150,20 +150,3 @@ const wchar_t *GetDefaultText(int c);
// function from multiwin module
void UpdateMwinData(MCONTACT hContact);
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// utils
-
-class JsonReply
-{
- JSONNode *m_root = nullptr;
- int m_errorCode = 0;
-
-public:
- JsonReply(MHttpResponse *);
- ~JsonReply();
-
- __forceinline int error() const { return m_errorCode; }
- __forceinline JSONNode &data() const { return *m_root; }
- __forceinline operator bool() const { return m_errorCode == 200; }
-};
diff --git a/protocols/Weather/src/weather_utils.cpp b/protocols/Weather/src/weather_utils.cpp
deleted file mode 100644
index b37b6bbe9a..0000000000
--- a/protocols/Weather/src/weather_utils.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
-Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-
-JsonReply::JsonReply(MHttpResponse *pReply)
-{
- if (pReply == nullptr) {
- m_errorCode = 500;
- return;
- }
-
- m_errorCode = pReply->resultCode;
-
- m_root = json_parse(pReply->body);
- if (m_root == nullptr)
- m_errorCode = 500;
-
- delete pReply;
-}
-
-JsonReply::~JsonReply()
-{
- json_delete(m_root);
-}
diff --git a/protocols/Weather/weather.vcxproj b/protocols/Weather/weather.vcxproj
index 8b18056c59..56a2b52edd 100644
--- a/protocols/Weather/weather.vcxproj
+++ b/protocols/Weather/weather.vcxproj
@@ -41,7 +41,6 @@
<ClCompile Include="src\weather_svcs.cpp" />
<ClCompile Include="src\weather_update.cpp" />
<ClCompile Include="src\weather_userinfo.cpp" />
- <ClCompile Include="src\weather_utils.cpp" />
<ClInclude Include="src\proto.h" />
<ClInclude Include="src\resource.h" />
<ClInclude Include="src\stdafx.h" />
diff --git a/protocols/Weather/weather.vcxproj.filters b/protocols/Weather/weather.vcxproj.filters
index 50c35cce0e..92a72a4653 100644
--- a/protocols/Weather/weather.vcxproj.filters
+++ b/protocols/Weather/weather.vcxproj.filters
@@ -41,9 +41,6 @@
<ClCompile Include="src\weather_proto.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\weather_utils.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\resource.h">