summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/chat_log.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp
index f0d0065e15..425f80753e 100644
--- a/src/mir_app/src/chat_log.cpp
+++ b/src/mir_app/src/chat_log.cpp
@@ -302,10 +302,12 @@ void CRtfLogWindow::CreateChatRtfEvent(RtfChatLogStreamData *streamData, const L
void CRtfLogWindow::CreateChatRtfMessage(RtfChatLogStreamData *streamData, const LOGINFO &lin, CMStringA &buf)
{
+ auto *si = streamData->si;
+
buf.AppendFormat("%s ", Log_SetStyle(lin.bIsHighlighted ? 16 : lin.getIndex()));
CMStringW wszCaption;
- bool bTextUsed = Chat_GetDefaultEventDescr(streamData->si, &lin, wszCaption);
+ bool bTextUsed = Chat_GetDefaultEventDescr(si, &lin, wszCaption);
if (!wszCaption.IsEmpty()) {
wszCaption.AppendChar(' ');
lin.write(streamData, !bTextUsed, buf, wszCaption);
@@ -316,6 +318,13 @@ void CRtfLogWindow::CreateChatRtfMessage(RtfChatLogStreamData *streamData, const
if (lin.hEvent) {
DB::EventInfo dbei(lin.hEvent);
if (dbei) {
+ if (!dbei.markedRead()) {
+ if (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE || dbei.isSrmm()) {
+ db_event_markRead(si->hContact, lin.hEvent);
+ g_clistApi.pfnRemoveEvent(si->hContact, lin.hEvent);
+ }
+ }
+
if (dbei.eventType == EVENTTYPE_FILE) {
DB::FILE_BLOB blob(dbei);
if (blob.isOffline()) {