summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-28 18:57:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-28 18:57:12 +0300
commit5700e47cc6b846081383972d0b90afee2bae8995 (patch)
tree01221e66231ee1628f231d63e92d48f53ac98245 /protocols
parent3a35e893b276bf28fbf949d67b92961bc5293b55 (diff)
Revert "fixes #2938 (MRA: contact search does not work)"
This reverts commit 3a35e893b276bf28fbf949d67b92961bc5293b55.
Diffstat (limited to 'protocols')
-rw-r--r--protocols/ICQ-WIM/src/http.cpp4
-rw-r--r--protocols/ICQ-WIM/src/options.cpp2
-rw-r--r--protocols/ICQ-WIM/src/proto.h1
-rw-r--r--protocols/ICQ-WIM/src/server.cpp2
-rw-r--r--protocols/ICQ-WIM/src/utils.cpp7
5 files changed, 4 insertions, 12 deletions
diff --git a/protocols/ICQ-WIM/src/http.cpp b/protocols/ICQ-WIM/src/http.cpp
index fded4807ea..79910dad11 100644
--- a/protocols/ICQ-WIM/src/http.cpp
+++ b/protocols/ICQ-WIM/src/http.cpp
@@ -104,7 +104,7 @@ AsyncRapiRequest::AsyncRapiRequest(CIcqProto *ppro, const char *pszMethod, MTHtt
{
params.set_name("params");
- if (ppro->SkipRapi()) {
+ if (ppro->getByte(DB_KEY_PHONEREG)) {
m_szUrl.AppendChar('/');
m_szUrl.Append(pszMethod);
@@ -181,7 +181,7 @@ bool CIcqProto::ExecuteRequest(AsyncHttpRequest *pReq)
}
// replace credentials inside JSON body for pure RAPI requests
- if (pReq->m_conn == CONN_RAPI && !mir_strcmp(pReq->szUrl, ICQ_ROBUST_SERVER) && !SkipRapi()) {
+ if (pReq->m_conn == CONN_RAPI && !mir_strcmp(pReq->szUrl, ICQ_ROBUST_SERVER) && !getByte(DB_KEY_PHONEREG)) {
CMStringA szAgent(FORMAT, "%S Mail.ru Windows ICQ (version 10.0.1999)", (wchar_t*)m_szOwnId);
pReq->AddHeader("User-Agent", szAgent);
pReq->AddHeader("Content-Type", "application/json");
diff --git a/protocols/ICQ-WIM/src/options.cpp b/protocols/ICQ-WIM/src/options.cpp
index 9a07a4b462..ab17121a30 100644
--- a/protocols/ICQ-WIM/src/options.cpp
+++ b/protocols/ICQ-WIM/src/options.cpp
@@ -58,7 +58,7 @@ public:
bool CIcqProto::RetrievePassword()
{
// if we registered via phone (i.e., server holds the password), we don't need to enter it
- if (SkipRapi())
+ if (getByte(DB_KEY_PHONEREG))
return true;
if (!m_szPassword.IsEmpty() && m_bRememberPwd)
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index 31b31b2c26..f36f6911ab 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -378,7 +378,6 @@ class CIcqProto : public PROTO<CIcqProto>
bool IsQueueEmpty();
void Push(MHttpRequest*);
bool RefreshRobustToken(AsyncHttpRequest *pReq);
- bool SkipRapi();
////////////////////////////////////////////////////////////////////////////////////////
// cache
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 2ee357ddef..6780daad1e 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -613,7 +613,7 @@ void CIcqProto::SetServerStatus(int iStatus)
Push(new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/presence/setState")
<< AIMSID(this) << CHAR_PARAM("view", szStatus) << INT_PARAM("invisible", invisible));
- if (iStatus == ID_STATUS_OFFLINE && !SkipRapi()) {
+ if (iStatus == ID_STATUS_OFFLINE && !getByte(DB_KEY_PHONEREG)) {
auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, ICQ_API_SERVER "/aim/endSession", &CIcqProto::OnSessionEnd);
pReq << AIMSID(this) << INT_PARAM("invalidateToken", 1);
ExecuteRequest(pReq);
diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp
index f2f70ad0bb..6bfc868e96 100644
--- a/protocols/ICQ-WIM/src/utils.cpp
+++ b/protocols/ICQ-WIM/src/utils.cpp
@@ -330,13 +330,6 @@ void CIcqProto::setId(MCONTACT hContact, const char *szSetting, __int64 iValue)
/////////////////////////////////////////////////////////////////////////////////////////
-bool CIcqProto::SkipRapi()
-{
- return m_isMra || getByte(DB_KEY_PHONEREG);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
wchar_t* time2text(time_t ts)
{
if (ts == 0)