diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-27 20:23:20 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-27 20:23:20 +0300 |
commit | d18fdf58c517c957809e9ec0b8044a05984de7c6 (patch) | |
tree | 795967aee27142f012f47e739b1bbb31c53b7450 /protocols/Telegram/src/proto.cpp | |
parent | abc610a264a0a9c03effe579283c7d4c4fdf08b5 (diff) |
fixes #4140 (NewStory: удаление отдельных сообщений)
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index 3b79b01e66..f1315dc56d 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -214,9 +214,9 @@ void CTelegramProto::OnErase() DeleteDirectoryTreeW(GetProtoFolder(), false); } -void CTelegramProto::OnEventDeleted(MCONTACT hContact, MEVENT hDbEvent) +void CTelegramProto::OnEventDeleted(MCONTACT hContact, MEVENT hDbEvent, int flags) { - if (!hContact) + if (!hContact || !(flags & CDF_FROM_SERVER)) return; auto *pUser = FindUser(GetId(hContact)); @@ -224,19 +224,21 @@ void CTelegramProto::OnEventDeleted(MCONTACT hContact, MEVENT hDbEvent) return; DB::EventInfo dbei(hDbEvent, false); - if (dbei.szId) { - mir_cslock lck(m_csDeleteMsg); - if (m_deleteChatId) { - if (m_deleteChatId != pUser->chatId) - SendDeleteMsg(); + if (!dbei.szId) + return; - m_impl.m_deleteMsg.Stop(); - } + mir_cslock lck(m_csDeleteMsg); + if (m_deleteChatId) { + if (m_deleteChatId != pUser->chatId) + SendDeleteMsg(); - m_deleteChatId = pUser->chatId; - m_deleteIds.push_back(dbei2id(dbei)); - m_impl.m_deleteMsg.Start(500); + m_impl.m_deleteMsg.Stop(); } + + m_bDeleteForAll = (flags & CDF_FOR_EVERYONE) != 0; + m_deleteChatId = pUser->chatId; + m_deleteIds.push_back(dbei2id(dbei)); + m_impl.m_deleteMsg.Start(500); } void CTelegramProto::OnEventEdited(MCONTACT hContact, MEVENT, const DBEVENTINFO &dbei) |