summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-09 15:34:29 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-09 15:34:29 +0300
commit5dd8452652544890fbc00501b2ba312cfd97beff (patch)
treee116f2b687c4a88d54c8c60ce2e93257910953fc /src/mir_app
parent2845fe740489165d8996ac11976a1821394020ac (diff)
DB::EventInfo.isAlertable - a helper to detect whether a SRMM window should be raised for an event or not
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/db_events.cpp13
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
3 files changed, 15 insertions, 0 deletions
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp
index 7026fe8905..cee5015c96 100644
--- a/src/mir_app/src/db_events.cpp
+++ b/src/mir_app/src/db_events.cpp
@@ -301,6 +301,19 @@ bool DB::EventInfo::isHistory() const
return et && et->flags & DETF_HISTORY;
}
+bool DB::EventInfo::isAlertable() const
+{
+ if (eventType == EVENTTYPE_MESSAGE)
+ return true;
+
+ if (eventType == EVENTTYPE_FILE) {
+ DB::FILE_BLOB blob(*this);
+ return blob.isOffline();
+ }
+
+ return false;
+}
+
wchar_t* DB::EventInfo::getString(const char *str) const
{
if (flags & DBEF_UTF)
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 070dbf3b52..c93fc79d87 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -916,3 +916,4 @@ Clist_GroupSaveExpanded @1003 NONAME
?onClick_CloseQuote@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @1034 NONAME
?fetch@EventInfo@DB@@QAE_NI_N@Z @1035 NONAME
?unload@EventInfo@DB@@QAEXXZ @1036 NONAME
+?isAlertable@EventInfo@DB@@QBE_NXZ @1037 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index ea073ca0d2..0284e7cbcd 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -916,3 +916,4 @@ Clist_GroupSaveExpanded @1003 NONAME
?onClick_CloseQuote@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @1034 NONAME
?fetch@EventInfo@DB@@QEAA_NI_N@Z @1035 NONAME
?unload@EventInfo@DB@@QEAAXXZ @1036 NONAME
+?isAlertable@EventInfo@DB@@QEBA_NXZ @1037 NONAME