diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-16 14:03:24 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-16 14:03:24 +0000 |
commit | 8bd2456f654ef5eea44fcf4ad6ce5f7107f7d829 (patch) | |
tree | 8ae03049734c96a5feba398f5c142d9a4213d640 /protocols | |
parent | c3908b9c6d53a6aef5e25975d3b336974e6dd610 (diff) |
IsStatusConnecting() - useful macro
git-svn-id: http://svn.miranda-ng.org/main/trunk@12860 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/AimOscar/src/links.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_queue.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_status.cpp | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/protocols/AimOscar/src/links.cpp b/protocols/AimOscar/src/links.cpp index b1c954d413..12f69bd9fc 100644 --- a/protocols/AimOscar/src/links.cpp +++ b/protocols/AimOscar/src/links.cpp @@ -77,7 +77,7 @@ static INT_PTR ServiceParseAimLink(WPARAM,LPARAM lParam) CAimProto *proto = &g_Instances[0];
for (int i = 0; i < g_Instances.getCount(); ++i)
{
- if (g_Instances[i].m_iStatus != ID_STATUS_OFFLINE && g_Instances[i].m_iStatus != ID_STATUS_CONNECTING)
+ if (g_Instances[i].m_iStatus != ID_STATUS_OFFLINE && !IsStatusConnecting(g_Instances[i].m_iStatus))
{
proto = &g_Instances[i];
break;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index b93b55c489..fc6e0612b7 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1117,7 +1117,7 @@ int __cdecl CJabberProto::SetStatus(int iNewStatus) m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
}
- else if (!m_ThreadInfo && !(m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
+ else if (!m_ThreadInfo && !IsStatusConnecting(m_iStatus)) {
m_iStatus = ID_STATUS_CONNECTING;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
ForkThread((MyThreadFunc)&CJabberProto::ServerThread, NULL);
diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index aed8f64e50..c01442fa26 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -56,7 +56,7 @@ void CVkProto::ExecuteRequest(AsyncHttpRequest *pReq) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)reply);
}
else if (pReq->bIsMainConn) {
- if (m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)
+ if (IsStatusConnecting(m_iStatus))
ConnectionFailed(LOGINERR_NONETWORK);
else if (pReq->m_iRetry && !m_bTerminated) {
pReq->bNeedsRestart = true;
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp index 6e9670e13d..e7d6ee7cc6 100644 --- a/protocols/VKontakte/src/vk_status.cpp +++ b/protocols/VKontakte/src/vk_status.cpp @@ -37,7 +37,7 @@ int CVkProto::SetStatus(int iNewStatus) ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
debugLogA("CVkProto::SetStatus (1) iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d oldStatus = %d", iNewStatus, m_iStatus, m_iDesiredStatus, oldStatus);
}
- else if (m_hWorkerThread == NULL && !(m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
+ else if (m_hWorkerThread == NULL && !IsStatusConnecting(m_iStatus)) {
m_iStatus = ID_STATUS_CONNECTING;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
debugLogA("CVkProto::SetStatus (2) iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d oldStatus = %d", iNewStatus, m_iStatus, m_iDesiredStatus, oldStatus);
@@ -50,7 +50,7 @@ int CVkProto::SetStatus(int iNewStatus) else {
debugLogA("CVkProto::SetStatus (4) iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d oldStatus = %d", iNewStatus, m_iStatus, m_iDesiredStatus, oldStatus);
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
- if (!(m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES))
+ if (!IsStatusConnecting(m_iStatus))
m_iDesiredStatus = m_iStatus;
debugLogA("CVkProto::SetStatus (5) iNewStatus = %d, m_iStatus = %d, m_iDesiredStatus = %d oldStatus = %d", iNewStatus, m_iStatus, m_iDesiredStatus, oldStatus);
}
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index c91b72dcc5..2b5c275981 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -137,7 +137,7 @@ int WhatsAppProto::SetStatus(int new_status) m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
}
- else if (m_pSocket == NULL && !(m_iStatus >= ID_STATUS_CONNECTING && m_iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
+ else if (m_pSocket == NULL && !IsStatusConnecting(m_iStatus)) {
m_iStatus = ID_STATUS_CONNECTING;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
|