diff options
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index 9a79af6d94..fff388caa5 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -491,7 +491,16 @@ int CTelegramProto::SendMsg(MCONTACT hContact, const char *pszMessage) if (szId == nullptr) return 0; - return SendTextMessage(_atoi64(szId), pszMessage); + __int64 id = _atoi64(szId); + auto *pUser = FindUser(id); + if (pUser == nullptr) + return 0; + + int msgid = SendTextMessage(pUser->chatId, pszMessage); + if (msgid != -1) + m_arOwnMsg.insert(new TG_OWN_MESSAGE(hContact, (HANDLE)msgid, -1)); + + return msgid; } int CTelegramProto::SetStatus(int iNewStatus) |