summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-27 20:23:20 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-27 20:23:20 +0300
commitd18fdf58c517c957809e9ec0b8044a05984de7c6 (patch)
tree795967aee27142f012f47e739b1bbb31c53b7450 /protocols/Telegram/src/proto.cpp
parentabc610a264a0a9c03effe579283c7d4c4fdf08b5 (diff)
fixes #4140 (NewStory: удаление отдельных сообщений)
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r--protocols/Telegram/src/proto.cpp26
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)