From c9b740a178828eae5cc4be7ab054e5f26d3a27e7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 Sep 2023 14:34:07 +0300 Subject: MessageWindowEventData: useless structure removed --- plugins/NewXstatusNotify/src/xstatus.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'plugins/NewXstatusNotify') diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 7b32997456..9be1a1176e 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -506,25 +506,26 @@ void AddSMsgEventThread(void *arg) mir_free(smi.newstatusmsg); } -int OnWindowEvent(WPARAM, LPARAM lParam) +int OnWindowEvent(WPARAM uType, LPARAM lParam) { - MessageWindowEventData *mwed = (MessageWindowEventData *)lParam; - if (mwed->uType == MSG_WINDOW_EVT_CLOSE) { + auto *pDlg = (CSrmmBaseDialog *)lParam; + + if (uType == MSG_WINDOW_EVT_CLOSE) { if (opt.XLogToDB && opt.XLogToDB_WinOpen && opt.XLogToDB_Remove) - RemoveLoggedEventsXStatus(mwed->hContact); + RemoveLoggedEventsXStatus(pDlg->m_hContact); if (opt.LogToDB && opt.LogToDB_WinOpen && opt.LogToDB_Remove) - RemoveLoggedEventsStatus(mwed->hContact); + RemoveLoggedEventsStatus(pDlg->m_hContact); if (opt.SMsgLogToDB && opt.SMsgLogToDB_WinOpen && opt.SMsgLogToDB_Remove) - RemoveLoggedEventsSMsg(mwed->hContact); + RemoveLoggedEventsSMsg(pDlg->m_hContact); } - else if (mwed->uType == MSG_WINDOW_EVT_OPEN) { - if (opt.XLogToDB && (templates.LogXFlags & NOTIFY_OPENING_ML) && g_plugin.getByte(mwed->hContact, "EnableXLogging", 1)) - mir_forkthread(AddXStatusEventThread, (void *)mwed->hContact); + else if (uType == MSG_WINDOW_EVT_OPEN) { + if (opt.XLogToDB && (templates.LogXFlags & NOTIFY_OPENING_ML) && g_plugin.getByte(pDlg->m_hContact, "EnableXLogging", 1)) + mir_forkthread(AddXStatusEventThread, (void *)pDlg->m_hContact); - if (opt.SMsgLogToDB && (templates.LogSMsgFlags & NOTIFY_OPENING_ML) && g_plugin.getByte(mwed->hContact, "EnableSMsgLogging", 1)) - mir_forkthread(AddSMsgEventThread, (void *)mwed->hContact); + if (opt.SMsgLogToDB && (templates.LogSMsgFlags & NOTIFY_OPENING_ML) && g_plugin.getByte(pDlg->m_hContact, "EnableSMsgLogging", 1)) + mir_forkthread(AddSMsgEventThread, (void *)pDlg->m_hContact); } return 0; } -- cgit v1.2.3