From a4682eddf8a152e6d31a8f51a078c273a2cfebbc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Oct 2023 20:10:09 +0300 Subject: =?UTF-8?q?fixes=20#3721=20(YAMN:=20=D0=BF=D0=B0=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B8=20=D0=BA=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=20=D0=B2=D1=81=D0=BF=D0=BB=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D1=8E=D1=89=D0=B5=D0=B5=20=D0=BE=D0=BA=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/YAMN/src/browser/badconnect.cpp | 4 --- protocols/YAMN/src/browser/mailbrowser.cpp | 54 ++++++++++-------------------- 2 files changed, 17 insertions(+), 41 deletions(-) diff --git a/protocols/YAMN/src/browser/badconnect.cpp b/protocols/YAMN/src/browser/badconnect.cpp index 47548685b4..f8f05d5da2 100644 --- a/protocols/YAMN/src/browser/badconnect.cpp +++ b/protocols/YAMN/src/browser/badconnect.cpp @@ -48,10 +48,6 @@ LRESULT CALLBACK BadConnectPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM } break; - case UM_FREEPLUGINDATA: - //Here we'd free our own data, if we had it. - return FALSE; - case UM_INITPOPUP: //This is the equivalent to WM_INITDIALOG you'd get if you were the maker of dialog popups. break; diff --git a/protocols/YAMN/src/browser/mailbrowser.cpp b/protocols/YAMN/src/browser/mailbrowser.cpp index f92e8b4d6a..faa60926e8 100644 --- a/protocols/YAMN/src/browser/mailbrowser.cpp +++ b/protocols/YAMN/src/browser/mailbrowser.cpp @@ -713,42 +713,30 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN, LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - INT_PTR PluginParam = 0; switch (msg) { case WM_COMMAND: // if clicked and it's new mail popup window - if ((HIWORD(wParam) == STN_CLICKED) && (-1 != (PluginParam = (INT_PTR)PUGetPluginData(hWnd)))) { - MCONTACT hContact = 0; - CAccount *Account; - if (PluginParam) { - YAMN_MAILSHOWPARAM *MailParam = new YAMN_MAILSHOWPARAM(); - memcpy(MailParam, (PINT_PTR)PluginParam, sizeof(YAMN_MAILSHOWPARAM)); - hContact = MailParam->account->hContact; - Account = MailParam->account; - mir_forkthread(ShowEmailThread, MailParam); - } - else { - hContact = PUGetContact(hWnd); - if (Account = FindAccountByContact(POP3Plugin, hContact)) { - SReadGuard sra(Account->AccountAccessSO); - if (sra.Succeeded()) { - switch (msg) { - case WM_COMMAND: - { - YAMN_MAILBROWSERPARAM Param = { Account, - (Account->NewMailN.Flags & ~YAMN_ACC_POP) | YAMN_ACC_MSGP | YAMN_ACC_MSG, - (Account->NoNewMailN.Flags & ~YAMN_ACC_POP) | YAMN_ACC_MSGP | YAMN_ACC_MSG }; - - RunMailBrowser(&Param); - } - break; + if (HIWORD(wParam) == STN_CLICKED) { + MCONTACT hContact = PUGetContact(hWnd); + if (CAccount *Account = FindAccountByContact(POP3Plugin, hContact)) { + SReadGuard sra(Account->AccountAccessSO); + if (sra.Succeeded()) { + switch (msg) { + case WM_COMMAND: + { + YAMN_MAILBROWSERPARAM Param = { Account, + (Account->NewMailN.Flags & ~YAMN_ACC_POP) | YAMN_ACC_MSGP | YAMN_ACC_MSG, + (Account->NoNewMailN.Flags & ~YAMN_ACC_POP) | YAMN_ACC_MSGP | YAMN_ACC_MSG }; + + RunMailBrowser(&Param); } + break; } } - } - if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) - Clist_RemoveEvent(hContact, hContact); + if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) + Clist_RemoveEvent(hContact, hContact); + } } __fallthrough; @@ -756,10 +744,6 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa PUDeletePopup(hWnd); break; - case UM_FREEPLUGINDATA: - delete (YAMN_MAILSHOWPARAM *)PUGetPluginData(hWnd); - return FALSE; - case UM_INITPOPUP: // This is the equivalent to WM_INITDIALOG you'd get if you were the maker of dialog popups. WindowList_Add(YAMNVar.MessageWnds, hWnd); @@ -809,10 +793,6 @@ LRESULT CALLBACK NoNewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l PUDeletePopup(hWnd); break; - case UM_FREEPLUGINDATA: - // Here we'd free our own data, if we had it. - return FALSE; - case UM_INITPOPUP: //This is the equivalent to WM_INITDIALOG you'd get if you were the maker of dialog popups. WindowList_Add(YAMNVar.MessageWnds, hWnd); -- cgit v1.2.3