diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-20 12:41:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-20 12:41:31 +0300 |
commit | 8227d51067e386cddbce4defefc34e608aed2c6b (patch) | |
tree | 49c45843c6491274e05a1aca42c4c75ae3239cbf | |
parent | 6b0b43a8f98c6899f67dc62f9c8b765014f37fda (diff) |
second instance of the same account status checker removed
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 30bb55bc94..1890142851 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -37,7 +37,8 @@ POINT tray_hover_pos = { 0 }; #ifndef _INC_SHLWAPI
-typedef struct _DllVersionInfo {
+typedef struct _DllVersionInfo
+{
DWORD cbSize;
DWORD dwMajorVersion; // Major version
DWORD dwMinorVersion; // Minor version
@@ -47,7 +48,7 @@ typedef struct _DllVersionInfo { #define DLLVER_PLATFORM_WINDOWS 0x00000001 // Windows 95
#define DLLVER_PLATFORM_NT 0x00000002 // Windows NT
-typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
+typedef HRESULT(CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *);
#endif
@@ -284,7 +285,7 @@ int GetGoodAccNum(bool *bDiffers, bool *bConn) BYTE d = 0;
for (i = AccNum, AccNum = 0; i--;) {
PROTOACCOUNT *pa = acc[i];
- if (!pa->bIsVirtual && pa->bIsVisible && !pa->bDynDisabled && pa->ppro) {
+ if (pcli->pfnGetProtocolVisibility(pa->szModuleName) && pa->ppro) {
AccNum++;
if (!d) {
s = pa->ppro->m_iStatus;
@@ -308,13 +309,10 @@ UINT_PTR TimerID = 0; int cliTrayIconInit(HWND hwnd)
{
- BYTE Mode;
-
if (pcli->trayIconCount != 0)
return 0;
- if (TimerID)
- {
+ if (TimerID) {
KillTimer(nullptr, TimerID);
TimerID = 0;
}
@@ -335,6 +333,7 @@ int cliTrayIconInit(HWND hwnd) return 0;
}
+ BYTE Mode;
if (!bDiffers) // all equal
OldMode = Mode = db_get_b(0, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
else
@@ -353,18 +352,18 @@ int cliTrayIconInit(HWND hwnd) break;
case TRAY_ICON_MODE_ACC:
- {
- ptrA szProto(db_get_sa(0, "CList", (!bDiffers) ? "tiAccS" : "tiAccV"));
- if (!szProto)
- break;
-
- PROTOACCOUNT *pa = Proto_GetAccount(szProto);
- if (!pa || !pa->ppro)
- pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
- else
- pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
- }
- break;
+ {
+ ptrA szProto(db_get_sa(0, "CList", (!bDiffers) ? "tiAccS" : "tiAccV"));
+ if (!szProto)
+ break;
+
+ PROTOACCOUNT *pa = Proto_GetAccount(szProto);
+ if (!pa || !pa->ppro)
+ pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
+ else
+ pcli->pfnTrayIconAdd(hwnd, pa->szModuleName, nullptr, pa->ppro->m_iStatus);
+ }
+ break;
case TRAY_ICON_MODE_CYCLE:
pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
@@ -479,4 +478,4 @@ int cliTrayCalcChanged(const char *szChangedProto, int, int) Shell_NotifyIcon(NIM_MODIFY, &nid);
return -1;
-}
\ No newline at end of file +}
|