summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-05 19:13:02 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-05 19:13:06 +0300
commit840abdb4bcb86f2d4398e423735ae0c39d2ef32b (patch)
treea1ba0f9cb76ef8ce45ae659620dd22ae1d30c311
parent99bdd52455ce99e89da7e1f0dafd019ac38af18d (diff)
for #4000 - offline files are marked read when shown in NewStory
-rw-r--r--plugins/NewStory/src/history_array.cpp16
-rw-r--r--plugins/NewStory/src/history_array.h1
2 files changed, 12 insertions, 5 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp
index 5b80cc4e52..c9353e88f0 100644
--- a/plugins/NewStory/src/history_array.cpp
+++ b/plugins/NewStory/src/history_array.cpp
@@ -352,11 +352,7 @@ void ItemData::load(bool bFullLoad)
switch (dbe.eventType) {
case EVENTTYPE_MESSAGE:
- if (!(dbe.flags & DBEF_SENT)) {
- if (!dbe.markedRead())
- db_event_markRead(hContact, hEvent);
- Clist_RemoveEvent(-1, hEvent);
- }
+ markRead();
__fallthrough;
case EVENTTYPE_STATUSCHANGE:
@@ -385,6 +381,7 @@ void ItemData::load(bool bFullLoad)
buf.AppendFormat(L" [$hicon=%p$]", g_plugin.getIcon(IDI_OK));
wtext = buf.Detach();
+ markRead();
break;
}
@@ -441,6 +438,15 @@ void ItemData::load(bool bFullLoad)
dbe.unload();
}
+void ItemData::markRead()
+{
+ if (!(dbe.flags & DBEF_SENT)) {
+ if (!dbe.markedRead())
+ db_event_markRead(hContact, hEvent);
+ Clist_RemoveEvent(-1, hEvent);
+ }
+}
+
void ItemData::setText()
{
data = MTextCreateEx(htuLog, formatRtf().GetBuffer(), MTEXT_FLG_RTF);
diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h
index b1f5a12e2c..7ec4168bf5 100644
--- a/plugins/NewStory/src/history_array.h
+++ b/plugins/NewStory/src/history_array.h
@@ -34,6 +34,7 @@ struct ItemData
ItemData* checkPrev(ItemData *pPrev);
ItemData* checkPrevGC(ItemData *pPrev);
void checkCreate(HWND hwnd);
+ void markRead();
void setText();
bool fetch(void);