summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-24 15:20:09 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-24 15:20:09 +0300
commitb873a2605a28bbf43e9cc6679562cf6bbabad601 (patch)
tree754f18843be4d45c84696ef43b8534a755dae985
parent131e161afd6727f859173c1adc76859ef2ca35c9 (diff)
for #4290 - popups about offline files are shown even if a SRMM window is opened
-rw-r--r--plugins/NewEventNotify/src/main.cpp11
-rw-r--r--src/mir_app/src/db_events.cpp12
2 files changed, 12 insertions, 11 deletions
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp
index deb741df44..f711c2aa5e 100644
--- a/plugins/NewEventNotify/src/main.cpp
+++ b/plugins/NewEventNotify/src/main.cpp
@@ -86,21 +86,18 @@ int HookedNewEvent(WPARAM hContact, LPARAM hDbEvent)
// is it an event sent by the user? -> don't show
if (dbei.flags & DBEF_SENT) {
// JK, only message event, do not influence others
- auto *pdata = PU_GetByContact(hContact, EVENTTYPE_MESSAGE);
+ auto *pdata = PU_GetByContact(hContact, dbei.eventType);
if (g_plugin.bHideSend && pdata)
PopupAct(pdata->hWnd, MASK_DISMISS, pdata); // JK, only dismiss, i.e. do not kill event (e.g. file transfer)
return 0;
}
- // which status do we have, are we allowed to post popups?
- // UNDER CONSTRUCTION!!!
- CallService(MS_CLIST_GETSTATUSMODE, 0, 0); /// TODO: JK: ????
- if (dbei.eventType == EVENTTYPE_MESSAGE && (g_plugin.bMsgWindowCheck && hContact && CheckMsgWnd(hContact)))
+ if (dbei.isSrmm() && (g_plugin.bMsgWindowCheck && hContact && CheckMsgWnd(hContact)))
return 0;
// is another popup for this contact already present? -> merge message popups if enabled
- auto *pdata = PU_GetByContact(hContact, EVENTTYPE_MESSAGE);
- if (dbei.eventType == EVENTTYPE_MESSAGE && g_plugin.bMergePopup && pdata)
+ auto *pdata = PU_GetByContact(hContact, dbei.eventType);
+ if (dbei.isSrmm() && g_plugin.bMergePopup && pdata)
PopupUpdate(*pdata, hDbEvent);
else
PopupShow(hContact, hDbEvent, dbei.eventType);
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp
index 901b48709c..992f4422f2 100644
--- a/src/mir_app/src/db_events.cpp
+++ b/src/mir_app/src/db_events.cpp
@@ -305,15 +305,19 @@ void DB::EventInfo::wipeNotify()
// could be displayed in a SRMM window
bool DB::EventInfo::isSrmm() const
{
- auto *et = DbEvent_GetType(szModule, eventType);
- return et && et->flags & DETF_MSGWINDOW;
+ if (auto *et = DbEvent_GetType(szModule, eventType))
+ return (et->flags & DETF_MSGWINDOW) != 0;
+
+ return (eventType == EVENTTYPE_MESSAGE || eventType == EVENTTYPE_FILE);
}
// could be displayed in a history window
bool DB::EventInfo::isHistory() const
{
- auto *et = DbEvent_GetType(szModule, eventType);
- return et && et->flags & DETF_HISTORY;
+ if (auto *et = DbEvent_GetType(szModule, eventType))
+ return (et->flags & DETF_HISTORY) != 0;
+
+ return (eventType == EVENTTYPE_MESSAGE || eventType == EVENTTYPE_FILE);
}
bool DB::EventInfo::isAlertable() const