summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-06 13:53:13 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-06 13:53:13 +0300
commite1d4521c5530e7f971f15fdec358f27e563553dd (patch)
tree7f73404af7c24a43b657e216e1545bcf5da16a77 /protocols
parent159d13282207fd1e3e1c030e1d254013f2e59de1 (diff)
code cleaning
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/connection.cpp9
-rw-r--r--protocols/Facebook/src/http.cpp2
-rw-r--r--protocols/ICQ-WIM/src/http.cpp3
-rw-r--r--protocols/SkypeWeb/src/request_queue.cpp6
-rw-r--r--protocols/Twitter/src/http.cpp9
-rw-r--r--protocols/VKontakte/src/vk_queue.cpp7
6 files changed, 2 insertions, 34 deletions
diff --git a/protocols/Discord/src/connection.cpp b/protocols/Discord/src/connection.cpp
index 00c9214b2c..6835713687 100644
--- a/protocols/Discord/src/connection.cpp
+++ b/protocols/Discord/src/connection.cpp
@@ -19,15 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void CDiscordProto::ExecuteRequest(AsyncHttpRequest *pReq)
{
- CMStringA str;
-
- if (!pReq->m_szParam.IsEmpty()) {
- if (pReq->requestType == REQUEST_GET) {
- str.Format("%s?%s", pReq->m_szUrl.c_str(), pReq->m_szParam.c_str());
- pReq->m_szUrl = str.GetBuffer();
- }
- }
-
if (pReq->m_bMainSite) {
pReq->flags |= NLHRF_PERSISTENT;
pReq->nlc = m_hAPIConnection;
diff --git a/protocols/Facebook/src/http.cpp b/protocols/Facebook/src/http.cpp
index caf8113ef7..191e6b78f0 100644
--- a/protocols/Facebook/src/http.cpp
+++ b/protocols/Facebook/src/http.cpp
@@ -163,8 +163,6 @@ AsyncHttpRequest* FacebookProto::CreateRequestGQL(int64_t query_id) {
MHttpResponse* FacebookProto::ExecuteRequest(AsyncHttpRequest *pReq)
{
pReq->flags |= NLHRF_HTTP11;
- if (!pReq->m_szParam.IsEmpty() && pReq->requestType == REQUEST_GET)
- pReq->m_szUrl.AppendFormat("?%s", pReq->m_szParam.c_str());
debugLogA("Executing request:\n%s", pReq->m_szUrl.c_str());
diff --git a/protocols/ICQ-WIM/src/http.cpp b/protocols/ICQ-WIM/src/http.cpp
index 97fc58875d..57941e5375 100644
--- a/protocols/ICQ-WIM/src/http.cpp
+++ b/protocols/ICQ-WIM/src/http.cpp
@@ -166,9 +166,6 @@ void AsyncHttpRequest::ReplaceJsonParam(const JSONNode &n)
bool CIcqProto::ExecuteRequest(AsyncHttpRequest *pReq)
{
- if (!pReq->m_szParam.IsEmpty() && pReq->requestType == REQUEST_GET)
- pReq->m_szUrl.AppendFormat("?%s", pReq->m_szParam.c_str());
-
// replace credentials inside JSON body for pure RAPI requests
if (pReq->m_conn == CONN_RAPI && !mir_strcmp(pReq->m_szUrl, ICQ_ROBUST_SERVER) && !getByte(DB_KEY_PHONEREG)) {
CMStringA szAgent(FORMAT, "%S Mail.ru Windows ICQ (version 10.0.1999)", (wchar_t*)m_szOwnId);
diff --git a/protocols/SkypeWeb/src/request_queue.cpp b/protocols/SkypeWeb/src/request_queue.cpp
index 9dd5ecd71e..46d881aae2 100644
--- a/protocols/SkypeWeb/src/request_queue.cpp
+++ b/protocols/SkypeWeb/src/request_queue.cpp
@@ -80,12 +80,6 @@ MHttpResponse* CSkypeProto::DoSend(AsyncHttpRequest *pReq)
if (!pReq->m_szParam.IsEmpty()) {
switch (pReq->requestType) {
- case REQUEST_GET:
- case REQUEST_DELETE:
- pReq->m_szUrl.AppendChar('?');
- pReq->m_szUrl.Append(pReq->m_szParam.c_str());
- break;
-
case REQUEST_PUT:
case REQUEST_POST:
if (!pReq->FindHeader("Content-Type")) {
diff --git a/protocols/Twitter/src/http.cpp b/protocols/Twitter/src/http.cpp
index 71aa265954..f228e68b2b 100644
--- a/protocols/Twitter/src/http.cpp
+++ b/protocols/Twitter/src/http.cpp
@@ -40,13 +40,8 @@ void CTwitterProto::Execute(AsyncHttpRequest *pReq)
else pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
pReq->AddHeader("Cache-Control", "no-cache");
}
- else {
- if (pReq->requestType == REQUEST_PATCH)
- pReq->requestType = REQUEST_POST;
-
- pReq->m_szUrl.AppendChar('?');
- pReq->m_szUrl += pReq->m_szParam;
- }
+ else if (pReq->requestType == REQUEST_PATCH)
+ pReq->requestType = REQUEST_POST;
}
// CMStringA auth(FORMAT, "%s:%s", OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET);
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp
index e42bd1db42..1f96049b75 100644
--- a/protocols/VKontakte/src/vk_queue.cpp
+++ b/protocols/VKontakte/src/vk_queue.cpp
@@ -34,17 +34,10 @@ void CVkProto::UninitQueue()
bool CVkProto::ExecuteRequest(AsyncHttpRequest *pReq)
{
- CMStringA str;
do {
pReq->bNeedsRestart = false;
pReq->m_iErrorCode = 0;
pReq->m_szUrl = pReq->m_szUrl.GetBuffer();
- if (!pReq->m_szParam.IsEmpty()) {
- if (pReq->requestType == REQUEST_GET) {
- str.Format("%s?%s", pReq->m_szUrl.c_str(), pReq->m_szParam.c_str());
- pReq->m_szUrl = str.GetBuffer();
- }
- }
if (pReq->m_bApiReq) {
pReq->flags |= NLHRF_PERSISTENT;