summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-30 13:35:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-30 13:35:41 +0300
commitc90272a48520b1937624c0058f94b06e536f5ff6 (patch)
tree61eb1096c0565273a08a54a9f528b1260fc5bddb /src
parent5d016227186f7f272e2d423f0628e705187a2dc3 (diff)
code cleaning
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/db.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index a8c2db679c..fb5095afdc 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
+#include <m_messagestate.h>
+
MIR_CORE_EXPORT MDatabaseCommon* g_pCurrDb = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -486,11 +488,12 @@ MIR_CORE_DLL(int) db_event_markRead(MCONTACT hContact, MEVENT hDbEvent, bool bFr
if (!g_pCurrDb->MarkEventRead(hContact, hDbEvent))
return 1;
- if (!bFromServer)
- if (auto *ppro = Proto_GetInstance(hContact)) {
- ppro->OnMarkRead(hContact, hDbEvent);
- return 0;
- }
+ if (bFromServer)
+ CallService(MS_MESSAGESTATE_UPDATE, hContact, MRD_TYPE_READ);
+ else if (auto *ppro = Proto_GetInstance(hContact)) {
+ ppro->OnMarkRead(hContact, hDbEvent);
+ return 0;
+ }
return 1;
}