summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-08 18:48:07 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-08 18:48:07 +0300
commit68f24bbe2000376776f640b33b569b8dbc87aedf (patch)
tree89500610a8117354ca1177531a6bf5357d600942 /protocols
parentc917ae9a7abdfde50c0bb1ceb85b91b9e55aa641 (diff)
fixes #4719 (MessageState: некорректно показывается статус прочитанности в Telegram)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Telegram/src/proto.h1
-rw-r--r--protocols/Telegram/src/server.cpp17
2 files changed, 17 insertions, 1 deletions
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index f3c66d3f50..e0f0ec1515 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -276,6 +276,7 @@ class CTelegramProto : public PROTO<CTelegramProto>
void ProcessMessageContent(TD::updateMessageContent *pObj);
void ProcessMessageReactions(TD::updateMessageInteractionInfo *pObj);
void ProcessOption(TD::updateOption *pObj);
+ void ProcessRemoteMarkRead(TD::updateChatReadOutbox *pObj);
void ProcessScopeNotification(TD::updateScopeNotificationSettings *pObj);
void ProcessStatus(TD::updateUserStatus *pObj);
void ProcessSuperGroup(TD::updateSupergroup *pObj);
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 2ba51b4787..b39c997d5c 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -248,10 +248,14 @@ void CTelegramProto::ProcessResponse(td::ClientManager::Response response)
ProcessMarkRead((TD::updateChatReadInbox *)response.object.get());
break;
+ case TD::updateChatReadOutbox::ID:
+ ProcessRemoteMarkRead((TD::updateChatReadOutbox *)response.object.get());
+ break;
+
case TD::updateDeleteMessages::ID:
ProcessDeleteMessage((TD::updateDeleteMessages*)response.object.get());
break;
-
+
case TD::updateConnectionState::ID:
ProcessConnectionState((TD::updateConnectionState *)response.object.get());
break;
@@ -1081,6 +1085,17 @@ void CTelegramProto::ProcessOption(TD::updateOption *pObj)
/////////////////////////////////////////////////////////////////////////////////////////
+void CTelegramProto::ProcessRemoteMarkRead(TD::updateChatReadOutbox *pObj)
+{
+ auto *pUser = FindChat(pObj->chat_id_);
+ if (pUser == nullptr) {
+ debugLogA("message from unknown chat/user, ignored");
+ return;
+ }
+
+ CallService(MS_MESSAGESTATE_UPDATE, GetRealContact(pUser), MRD_TYPE_READ);
+}
+
void CTelegramProto::ProcessScopeNotification(TD::updateScopeNotificationSettings *pObj)
{
switch (pObj->scope_->get_id()) {