summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-03 13:46:55 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-03 13:46:55 +0300
commit6cade9acbd5067761f068ba819008eb3084239b4 (patch)
tree6576dc0e8a03e4f15a53f8432639a106755a9653 /protocols/Telegram
parentfe8e65a6696f1a4623111125ad10019caf3141dd (diff)
Telegram: fix for duplicate outgoing messages
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/server.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 3b8ddda8ca..493b88bb7e 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -227,7 +227,7 @@ void CTelegramProto::OnSendMessage(td::ClientManager::Response &response, void *
if (pUser) {
char szMsgId[100];
_i64toa(pMessage->id_, szMsgId, 10);
- ProtoBroadcastAck(pUser->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, pUserInfo, (LPARAM)szMsgId);
+ ProtoBroadcastAck(pUser->hContact ? pUser->hContact : m_iSavedMessages, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, pUserInfo, (LPARAM)szMsgId);
}
}
@@ -627,6 +627,8 @@ void CTelegramProto::ProcessMessage(const TD::message *pMessage)
char szId[100], szUserId[100];
_i64toa(pMessage->id_, szId, 10);
+ if (db_event_getById(m_szModuleName, szId))
+ return;
PROTORECVEVENT pre = {};
pre.szMessage = szText.GetBuffer();