diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-07-28 18:18:04 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-07-28 18:18:04 +0000 |
commit | fded5c38c6eb27b83817978148a65e4fa60be26e (patch) | |
tree | 3f46f6dc4308cc7afb93d6382fd2e36e6df73082 /protocols/MSN/src/msn_misc.cpp | |
parent | e473743d5cfd6ebbca70336bf487a7f6ca31cef2 (diff) |
MSN:
- Popups on login errors
git-svn-id: http://svn.miranda-ng.org/main/trunk@14745 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_misc.cpp')
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index cce21faa02..9f7f6ab15f 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -967,6 +967,26 @@ void CMsnProto::MSN_ShowError(const char* msgtext, ...) MSN_ShowPopup(m_tszUserName, tBuffer, MSN_ALLOW_MSGBOX | MSN_SHOW_ERROR, NULL);
}
+void HandlePopupData(PopupData *tData) {
+ if (tData != NULL) {
+ if (tData->flags & MSN_HOTMAIL_POPUP) {
+ MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
+ if (hContact) CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)1);
+ if (tData->flags & MSN_ALLOW_ENTER)
+ tData->proto->MsnInvokeMyURL(true, tData->url);
+ }
+ else if (tData->url != NULL)
+ Utils_OpenUrl(tData->url);
+ }
+}
+
+void RemovePopupData(PopupData *tData) {
+ if (tData != NULL && (tData->flags & MSN_HOTMAIL_POPUP)) {
+ MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
+ if (hContact)
+ CallService(MS_CLIST_REMOVEEVENT, hContact, 1);
+ }
+}
/////////////////////////////////////////////////////////////////////////////////////////
// Popup plugin window proc
@@ -976,25 +996,12 @@ LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara switch (msg) {
case WM_COMMAND:
- if (tData != NULL) {
- if (tData->flags & MSN_HOTMAIL_POPUP) {
- MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
- if (hContact) CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)1);
- if (tData->flags & MSN_ALLOW_ENTER)
- tData->proto->MsnInvokeMyURL(true, tData->url);
- }
- else if (tData->url != NULL)
- Utils_OpenUrl(tData->url);
- }
+ HandlePopupData(tData);
PUDeletePopup(hWnd);
break;
case WM_CONTEXTMENU:
- if (tData != NULL && tData->flags & MSN_HOTMAIL_POPUP) {
- MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
- if (hContact)
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)1);
- }
+ RemovePopupData(tData);
PUDeletePopup(hWnd);
break;
@@ -1062,8 +1069,12 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) if (pud->flags & MSN_ALLOW_MSGBOX) {
TCHAR szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
mir_sntprintf(szMsg, _countof(szMsg), _T("%s:\n%s"), pud->title, pud->text);
- MessageBox(NULL, szMsg, TranslateT("MSN Protocol"),
- MB_OK | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
+ int ret = MessageBox(NULL, szMsg, TranslateT("MSN Protocol"),
+ MB_YESNO | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
+ if (ret == IDYES)
+ HandlePopupData(pud);
+ else
+ RemovePopupData(pud);
}
mir_free(pud->title);
mir_free(pud->text);
|