summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-15 13:24:23 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-15 13:24:23 +0300
commit673975b4ff7067257e8fe4c9b835a9663b6d5178 (patch)
tree17483f8faf334ff12b9b5e48e91d279fc2faf37c /protocols/ICQ-WIM
parentc85590b8045696a04392129899a089baca1ce8a0 (diff)
fixes #4116 (ICQ: поддержать режим "Invisible")
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp3
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp3
-rw-r--r--protocols/ICQ-WIM/src/proto.h2
-rw-r--r--protocols/ICQ-WIM/src/server.cpp6
-rw-r--r--protocols/ICQ-WIM/src/version.h2
5 files changed, 10 insertions, 6 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index dd259cb3ca..2972ce770c 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -389,6 +389,9 @@ void __cdecl CIcqProto::PollThread(void*)
else
szUrl.Append("&timeout=25000");
+ if (m_bInvisible)
+ szUrl.Append("&bg=1&hidden=1");
+
auto *pReq = new AsyncHttpRequest(CONN_FETCH, REQUEST_GET, szUrl, &CIcqProto::OnFetchEvents);
if (!m_bFirstBos)
pReq->timeout = 62000;
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 2cd7f50e4b..de01c7ebfa 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -492,7 +492,7 @@ INT_PTR CIcqProto::GetCaps(int type, MCONTACT)
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_INVISIBLE;
case PFLAGNUM_5:
- return PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_INVISIBLE;
+ return PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND;
case PFLAGNUM_4:
nReturn = PF4_FORCEAUTH | PF4_SUPPORTIDLE | PF4_OFFLINEFILES | PF4_IMSENDOFFLINE | PF4_SUPPORTTYPING |
@@ -612,6 +612,7 @@ int CIcqProto::SetStatus(int iNewStatus)
switch (iNewStatus) {
case ID_STATUS_OFFLINE:
case ID_STATUS_ONLINE:
+ case ID_STATUS_INVISIBLE:
break;
default:
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index 7de752df5b..72da1da766 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -212,7 +212,7 @@ class CIcqProto : public PROTO<CIcqProto>
friend AsyncHttpRequest* operator <<(AsyncHttpRequest*, const AIMSID&);
- bool m_bOnline, m_bTerminated, m_bFirstBos, m_isMra, m_bError462;
+ bool m_bOnline, m_bTerminated, m_bFirstBos, m_isMra, m_bError462, m_bInvisible;
int m_iTimeShift;
MCONTACT CheckOwnMessage(const CMStringA &reqId, const CMStringA &msgId, bool bRemove);
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index 91a54ee05e..b41d88dbfd 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -937,7 +937,7 @@ void CIcqProto::SetOwnId(const CMStringW &wszId)
void CIcqProto::SetServerStatus(int iStatus)
{
const char *szStatus = "online";
- int invisible = 0;
+ m_bInvisible = false;
switch (iStatus) {
case ID_STATUS_OFFLINE: szStatus = "offline"; break;
@@ -945,11 +945,11 @@ void CIcqProto::SetServerStatus(int iStatus)
case ID_STATUS_AWAY:
case ID_STATUS_DND: szStatus = "away"; break;
case ID_STATUS_INVISIBLE:
- invisible = 1;
+ m_bInvisible = true;
}
Push(new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, "/presence/setState")
- << AIMSID(this) << CHAR_PARAM("view", szStatus) << INT_PARAM("invisible", invisible));
+ << AIMSID(this) << CHAR_PARAM("view", szStatus) << INT_PARAM("invisible", m_bInvisible));
if (iStatus == ID_STATUS_OFFLINE && !getByte(DB_KEY_PHONEREG)) {
auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, "/aim/endSession", &CIcqProto::OnSessionEnd);
diff --git a/protocols/ICQ-WIM/src/version.h b/protocols/ICQ-WIM/src/version.h
index 7a79d5f09d..5ab76a1f28 100644
--- a/protocols/ICQ-WIM/src/version.h
+++ b/protocols/ICQ-WIM/src/version.h
@@ -1,6 +1,6 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 96
-#define __RELEASE_NUM 4
+#define __RELEASE_NUM 5
#define __BUILD_NUM 1
#include <stdver.h>