From f887d23e058b52c1eca2fa4980bf82b4c5289fd7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jun 2014 18:58:21 +0000 Subject: preventing tabSRMM from displaying irrelevant events git-svn-id: http://svn.miranda-ng.org/main/trunk@9569 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/generic_msghandlers.cpp | 34 +++++++++++++---------------- plugins/TabSRMM/src/msgdialog.cpp | 7 +++--- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 1491f49c1a..a7465ba712 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1594,7 +1594,7 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam) * incoming event handler */ -void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) +void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) { TContainerData *m_pContainer = dat->pContainer; DWORD dwTimestamp = 0; @@ -1642,32 +1642,28 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) } } if (!bDisableNotify) - tabSRMM_ShowPopup(wParam, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat); + tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat); if (IsWindowVisible(m_pContainer->hwnd)) m_pContainer->fHidden = false; } dat->cache->updateStats(TSessionStats::UPDATE_WITH_LAST_RCV, 0); if (hDbEvent != dat->hDbEventFirst) { - HANDLE nextEvent = db_event_next(dat->hContact, hDbEvent); - if (1 || nextEvent == 0) { - if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED)) - SendMessage(hwndDlg, DM_APPENDTOLOG, lParam, 0); - else { - TCHAR szBuf[100]; - - if (dat->iNextQueuedEvent >= dat->iEventQueueSize) { - dat->hQueuedEvents = (HANDLE*)mir_realloc(dat->hQueuedEvents, (dat->iEventQueueSize + 10) * sizeof(HANDLE)); - dat->iEventQueueSize += 10; - } - dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; - mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("Autoscrolling is disabled, %d message(s) queued (press F12 to enable it)"), - dat->iNextQueuedEvent); - SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); - RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE); + if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED)) + SendMessage(hwndDlg, DM_APPENDTOLOG, lParam, 0); + else { + if (dat->iNextQueuedEvent >= dat->iEventQueueSize) { + dat->hQueuedEvents = (HANDLE*)mir_realloc(dat->hQueuedEvents, (dat->iEventQueueSize + 10) * sizeof(HANDLE)); + dat->iEventQueueSize += 10; } + dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; + + TCHAR szBuf[100]; + mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("Autoscrolling is disabled, %d message(s) queued (press F12 to enable it)"), + dat->iNextQueuedEvent); + SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf); + RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE); } - else SendMessage(hwndDlg, DM_REMAKELOG, 0, 0); } else SendMessage(hwndDlg, DM_REMAKELOG, 0, 0); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 2b77f8b9b4..2f0e79c86c 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2499,7 +2499,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (!dat) return 0; if (dat->hContact) - if (wParam == dat->hContact || wParam == db_mc_getMeta(dat->hContact)) + if (dat->hContact == wParam || dat->hContact == db_event_getContact(HANDLE(lParam))) DM_EventAdded(dat, dat->hContact, lParam); return 0; @@ -2799,9 +2799,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_COMMAND: if (!dat) break; + // custom button handling - if (LOWORD(wParam)>=MIN_CBUTTONID&&LOWORD(wParam)<=MAX_CBUTTONID) { - BB_CustomButtonClick(dat,LOWORD(wParam) ,GetDlgItem(hwndDlg,LOWORD(wParam)),0); + if (LOWORD(wParam) >= MIN_CBUTTONID && LOWORD(wParam) <= MAX_CBUTTONID) { + BB_CustomButtonClick(dat, LOWORD(wParam), GetDlgItem(hwndDlg, LOWORD(wParam)), 0); break; } -- cgit v1.2.3