From c90272a48520b1937624c0058f94b06e536f5ff6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 30 Sep 2024 13:35:41 +0300 Subject: code cleaning --- src/mir_core/src/db.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') 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 + 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; } -- cgit v1.2.3