summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-05 20:44:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-05 20:44:01 +0300
commit4549087d4f7044dbf51a75d1af605ac93f6fbd6b (patch)
tree277bede3e6aab34535e71dce09cbbad4f3728af5 /protocols
parent55c9a5eb7104f24342e121f7b949eaf4cc5557b5 (diff)
fixes #3709 (GmailNotifier: изменение учётных данных в Миранде приводит к неработоспособности плагина до перезапуска)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/GmailNotifier/src/main.cpp4
-rw-r--r--protocols/GmailNotifier/src/notify.cpp4
-rw-r--r--protocols/GmailNotifier/src/options.cpp7
-rw-r--r--protocols/GmailNotifier/src/stdafx.h2
-rw-r--r--protocols/GmailNotifier/src/version.h2
5 files changed, 12 insertions, 7 deletions
diff --git a/protocols/GmailNotifier/src/main.cpp b/protocols/GmailNotifier/src/main.cpp
index 66c1bfaa63..55f05feef0 100644
--- a/protocols/GmailNotifier/src/main.cpp
+++ b/protocols/GmailNotifier/src/main.cpp
@@ -17,7 +17,7 @@ HNETLIBUSER hNetlibUser;
NOTIFYICONDATA niData;
OBJLIST<Account> g_accs(1);
-BOOL optionWindowIsOpen = FALSE;
+bool g_bOptionWindowIsOpen = false;
short ID_STATUS_NONEW;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -81,7 +81,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
INT_PTR PluginMenuCommand(WPARAM hContact, LPARAM)
{
- if (!optionWindowIsOpen)
+ if (!g_bOptionWindowIsOpen)
mir_forkthread(Check_ThreadFunc, GetAccountByContact(hContact));
return 0;
diff --git a/protocols/GmailNotifier/src/notify.cpp b/protocols/GmailNotifier/src/notify.cpp
index 99b26b8f55..5b797c221a 100644
--- a/protocols/GmailNotifier/src/notify.cpp
+++ b/protocols/GmailNotifier/src/notify.cpp
@@ -74,7 +74,7 @@ int OpenBrowser(WPARAM hContact, LPARAM)
Account *curAcc = GetAccountByContact(hContact);
PUDeletePopup(curAcc->popUpHwnd);
Clist_RemoveEvent(curAcc->hContact, 1);
- if (GetKeyState(VK_SHIFT) >> 8 || optionWindowIsOpen)
+ if (GetKeyState(VK_SHIFT) >> 8 || g_bOptionWindowIsOpen)
return FALSE;
if (curAcc->oldResults_num != 0) {
@@ -121,7 +121,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
void NotifyUser(Account *curAcc)
{
- if (optionWindowIsOpen)
+ if (g_bOptionWindowIsOpen)
return;
db_set_s(curAcc->hContact, "CList", "MyHandle", curAcc->results.content);
diff --git a/protocols/GmailNotifier/src/options.cpp b/protocols/GmailNotifier/src/options.cpp
index b8b9a5955b..ee40329809 100644
--- a/protocols/GmailNotifier/src/options.cpp
+++ b/protocols/GmailNotifier/src/options.cpp
@@ -64,7 +64,7 @@ public:
bool OnInitDialog() override
{
- optionWindowIsOpen = TRUE;
+ g_bOptionWindowIsOpen = true;
BuildList();
for (auto &it : g_accs)
@@ -142,6 +142,11 @@ public:
return true;
}
+ void OnDestroy() override
+ {
+ g_bOptionWindowIsOpen = false;
+ }
+
void onChange_Proxy(CCtrlCheck *)
{
int ShowControl = IsDlgButtonChecked(m_hwnd, IDC_STARTPRG) ? SW_SHOW : SW_HIDE;
diff --git a/protocols/GmailNotifier/src/stdafx.h b/protocols/GmailNotifier/src/stdafx.h
index 2140cb6aed..9a1c7c97ab 100644
--- a/protocols/GmailNotifier/src/stdafx.h
+++ b/protocols/GmailNotifier/src/stdafx.h
@@ -58,7 +58,7 @@ struct Account : public MZeroedObject
extern HNETLIBUSER hNetlibUser;
extern UINT hTimer;
extern short ID_STATUS_NONEW;
-extern BOOL optionWindowIsOpen;
+extern bool g_bOptionWindowIsOpen;
extern OBJLIST<Account> g_accs;
INT_PTR Notifying(WPARAM, LPARAM);
diff --git a/protocols/GmailNotifier/src/version.h b/protocols/GmailNotifier/src/version.h
index 7e9d79cb11..5070fc3b32 100644
--- a/protocols/GmailNotifier/src/version.h
+++ b/protocols/GmailNotifier/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 1
#define __MINOR_VERSION 0
#define __RELEASE_NUM 1
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>