diff options
Diffstat (limited to 'protocols/Telegram/src/server.cpp')
-rw-r--r-- | protocols/Telegram/src/server.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 2d3062d700..681a4344be 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -1087,10 +1087,15 @@ void CTelegramProto::ProcessRemoteMarkRead(TD::updateChatReadOutbox *pObj) CMStringA szMaxId(msg2id(pUser->chatId, pObj->last_read_outbox_message_id_));
MarkRead(pUser->hContact, szMaxId, true);
- CallService(MS_MESSAGESTATE_UPDATE, GetRealContact(pUser), MRD_TYPE_READ);
-
- if (auto hEvent = db_event_getById(m_szModuleName, szMaxId))
- NS_NotifyRemoteRead(GetRealContact(pUser), hEvent);
+ auto hContact = GetRealContact(pUser);
+ if (g_plugin.hasMessageState)
+ CallService(MS_MESSAGESTATE_UPDATE, hContact, MRD_TYPE_READ);
+
+ if (auto hEvent = db_event_getById(m_szModuleName, szMaxId)) {
+ setDword(hContact, DBKEY_REMOTE_READ, hEvent);
+ if (g_plugin.hasNewStory)
+ NS_NotifyRemoteRead(hContact, hEvent);
+ }
}
void CTelegramProto::ProcessScopeNotification(TD::updateScopeNotificationSettings *pObj)
|