summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r--protocols/Telegram/src/server.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 31a4010983..2b2e1a4e63 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -429,7 +429,7 @@ void CTelegramProto::OnGetHistory(td::ClientManager::Response &response, void *p
if (db_event_getById(m_szModuleName, szMsgId))
continue;
- CMStringA szBody = GetMessageText(pUser, pMsg, true);
+ CMStringA szBody = GetMessageText(pUser, pMsg, true), szReplyId;
if (szBody.IsEmpty())
continue;
@@ -445,6 +445,10 @@ void CTelegramProto::OnGetHistory(td::ClientManager::Response &response, void *p
dbei.flags |= DBEF_SENT;
if (this->GetGcUserId(pUser, pMsg, szUserId))
dbei.szUserId = szUserId;
+ if (pMsg->reply_to_message_id_) {
+ szReplyId = msg2id(pMsg->chat_id_, pMsg->reply_to_message_id_);
+ dbei.szReplyId = szReplyId;
+ }
db_event_add(GetRealContact(pUser), &dbei);
}