summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-07 13:17:02 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-07 13:17:02 +0300
commitffb61c98cc33470e7f5f6051c91d2b01a16eb143 (patch)
treef6b19ead3fed7f8e16e5947570dca0bf88e8a500 /protocols/ICQ-WIM
parent48e20e975ee04e6e84cf920d590c94f82306527e (diff)
fixes #4102 (ICQ, Facebook: ротоколы выставляют неподдерживаемые/некорректные статусы)
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index ac913a8afe..9173a4faca 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -616,10 +616,18 @@ int CIcqProto::SetStatus(int iNewStatus)
{
debugLogA("CIcqProto::SetStatus iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d m_hWorkerThread = %p", iNewStatus, m_iStatus, m_iDesiredStatus, m_hWorkerThread);
+ switch (iNewStatus) {
+ case ID_STATUS_OFFLINE:
+ case ID_STATUS_ONLINE:
+ break;
+
+ default:
+ iNewStatus = ID_STATUS_ONLINE;
+ }
+
if (iNewStatus == m_iStatus)
return 0;
- m_iDesiredStatus = iNewStatus;
int iOldStatus = m_iStatus;
// go offline
@@ -627,13 +635,17 @@ int CIcqProto::SetStatus(int iNewStatus)
if (m_bOnline)
SetServerStatus(ID_STATUS_OFFLINE);
- m_iStatus = m_iDesiredStatus;
+ m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
setAllContactStatuses(ID_STATUS_OFFLINE, false);
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus);
+ return 0;
}
+
+ m_iDesiredStatus = iNewStatus;
+
// not logged in? come on
- else if (!m_bOnline && !IsStatusConnecting(m_iStatus)) {
+ if (!m_bOnline && !IsStatusConnecting(m_iStatus)) {
m_iStatus = ID_STATUS_CONNECTING;
ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus);
@@ -655,7 +667,6 @@ int CIcqProto::SetStatus(int iNewStatus)
debugLogA("setting server online status to %d", iNewStatus);
SetServerStatus(iNewStatus);
}
-
return 0;
}