summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-06-17 12:17:44 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-06-17 12:17:44 +0300
commita228b0e44e9da5c5ef2f871f0cce63a4e8ae18ac (patch)
tree2a45928340873b2fbec55501ca4803ac36a45037 /protocols/Telegram/src/server.cpp
parent9aee9deca972b405a09033456ec2f270eea96cd3 (diff)
fixes #4466 (Telegram: при очистке истории канала нужно блокировать опции про удаление истории с сервера)
Diffstat (limited to 'protocols/Telegram/src/server.cpp')
-rw-r--r--protocols/Telegram/src/server.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 0568151f6d..cee7b9b1c3 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -498,10 +498,18 @@ INT_PTR CTelegramProto::SvcLoadServerHistory(WPARAM hContact, LPARAM)
///////////////////////////////////////////////////////////////////////////////
-INT_PTR CTelegramProto::SvcEmptyServerHistory(WPARAM hContact, LPARAM lParam)
+INT_PTR CTelegramProto::SvcCanEmptyHistory(WPARAM hContact, LPARAM)
{
- debugLogW(L"SvcEmptyServerHistory was called for cc=%d (%s)", (int)hContact, Clist_GetContactDisplayName(hContact));
+ if (auto *pUser = FindUser(GetId(hContact))) {
+ TG_SUPER_GROUP tmp(pUser->id, 0);
+ return m_arSuperGroups.find(&tmp) == nullptr;
+ }
+ return 0;
+}
+
+INT_PTR CTelegramProto::SvcEmptyServerHistory(WPARAM hContact, LPARAM lParam)
+{
if (auto *pUser = FindUser(GetId(hContact)))
if (pUser->chatId != -1)
SendQuery(new TD::deleteChatHistory(pUser->chatId, false, (lParam & CDF_FOR_EVERYONE) != 0));