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 /plugins/StatusPlugins | |
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 'plugins/StatusPlugins')
-rw-r--r-- | plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 6 | ||||
-rw-r--r-- | plugins/StatusPlugins/commonstatus.cpp | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 81461cba9b..bb4ff2f96c 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -605,7 +605,7 @@ static VOID CALLBACK CheckConnectingTimer(HWND, UINT, UINT_PTR, DWORD) TConnectionSettings& cs = connectionSettings[i]; int curStatus = GetStatus(cs); - if (curStatus < MAX_CONNECT_RETRIES) { // connecting + if (IsStatusConnecting(curStatus)) { // connecting maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0); if (maxConnectingTime > 0) { if ((unsigned int)maxConnectingTime <= ((GetTickCount() - cs.lastStatusAckTime) / 1000)) { @@ -633,7 +633,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) if (curStatus == ID_STATUS_CURRENT || curStatus == ID_STATUS_DISABLED || curStatus == newStatus || newStatus > MAX_STATUS) continue; - if (newStatus < MAX_CONNECT_RETRIES) { // connecting + if (IsStatusConnecting(newStatus)) { // connecting maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0); if (maxConnectingTime > 0) StartTimer(IDT_CHECKCONNECTING, (maxConnectingTime * 1000 - (GetTickCount() - cs.lastStatusAckTime)), FALSE); @@ -850,7 +850,7 @@ static void CheckContinueslyFunction(void *) if (!IsSuitableProto(protos[i])) continue; - if (CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0) < MAX_CONNECT_RETRIES) { + if (IsStatusConnecting(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0))) { log_debugA("CheckContinueslyFunction: %s is connecting", protos[i]->szModuleName); continue; // connecting, leave alone } diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index 573ae414ae..1ff0f978de 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -233,7 +233,8 @@ INT_PTR SetStatusEx(WPARAM wParam, LPARAM) int oldstatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
// set last status
protoSettings[i]->lastStatus = oldstatus;
- if (oldstatus <= MAX_CONNECT_RETRIES) {// ignore if connecting, but it didn't came this far if it did
+ if (IsStatusConnecting(oldstatus)) {
+ // ignore if connecting, but it didn't came this far if it did
log_debugA("CommonStatus: %s is already connecting", szProto);
continue;
}
|