summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Dbx_sqlite/src/dbevents.cpp2
-rw-r--r--plugins/NewStory/src/history_array.cpp3
-rw-r--r--plugins/NewStory/src/history_control.cpp13
3 files changed, 14 insertions, 4 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp
index 541a4d8ff4..3d26ec28c5 100644
--- a/plugins/Dbx_sqlite/src/dbevents.cpp
+++ b/plugins/Dbx_sqlite/src/dbevents.cpp
@@ -424,7 +424,7 @@ BOOL CDbxSQLite::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
dbei->timestamp = sqlite3_column_int64(stmt, 1);
dbei->eventType = sqlite3_column_int(stmt, 2);
dbei->flags = sqlite3_column_int64(stmt, 3);
- dbei->hContact = sqlite3_column_int(stmt, 8);
+ dbei->hContact = sqlite3_column_int(stmt, 9);
p = (char *)sqlite3_column_text(stmt, 4);
if (mir_strlen(p)) {
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp
index 9bc64a2f81..809035274e 100644
--- a/plugins/NewStory/src/history_array.cpp
+++ b/plugins/NewStory/src/history_array.cpp
@@ -408,7 +408,8 @@ void ItemData::load(int flags)
buf.AppendFormat(TranslateT(" %u KB"), size < 1024 ? 1 : unsigned(blob.getSize() / 1024));
wtext = buf.Detach();
- markRead();
+ if (!(flags & LOAD_BACK))
+ markRead();
break;
}
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index b2b83ebc44..441eda90fd 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -121,8 +121,17 @@ static void __cdecl sttLoadItems(void *param)
auto *pData = (NewstoryListData *)param;
for (int i = pData->totalCount-1; i >= 0; i--) {
auto *pItem = pData->LoadItem(i, true);
- if (pItem->dbe.eventType == EVENTTYPE_MESSAGE && !(pItem->dbe.flags & DBEF_SENT) && !pItem->dbe.markedRead())
- PostMessage(pData->m_hwnd, UM_MARKREAD, WPARAM(pItem), 0);
+ switch (pItem->dbe.eventType) {
+ case EVENTTYPE_FILE:
+ if (!pItem->m_bOfflineFile)
+ break;
+ __fallthrough;
+
+ case EVENTTYPE_MESSAGE:
+ if (!(pItem->dbe.flags & DBEF_SENT) && !pItem->dbe.markedRead())
+ PostMessage(pData->m_hwnd, UM_MARKREAD, WPARAM(pItem), 0);
+ break;
+ }
if ((i % 100) == 0)
Sleep(50);