From 8449b1715de83ee5c997c8aac613e7efac9460d3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Sep 2024 18:04:01 +0300 Subject: =?UTF-8?q?fixes=20#4608=20(Telegram:=20=D1=83=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=BB=D0=B6=D0=BD=D0=B0=20=D0=B1=D1=8B=D1=82=D1=8C=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BF=D0=BD=D0=B0=20=D0=BE?= =?UTF-8?q?=D0=BF=D1=86=D0=B8=D1=8F=20"=D1=83=D0=B4=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D1=8E=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=B2=D1=81=D0=B5=D1=85")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/proto.cpp | 13 +++++++++---- protocols/Telegram/src/server.cpp | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index b270c760d7..07cba42bc9 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -334,8 +334,10 @@ int CTelegramProto::AuthRequest(MCONTACT hContact, const wchar_t *) return 0; } -INT_PTR CTelegramProto::GetCaps(int type, MCONTACT) +INT_PTR CTelegramProto::GetCaps(int type, MCONTACT hContact) { + uint32_t ret; + switch (type) { case PFLAGNUM_1: return PF1_IM | PF1_FILE | PF1_CHAT | PF1_SEARCHBYNAME | PF1_ADDSEARCHRES | PF1_MODEMSGRECV | PF1_SERVERCLIST; @@ -344,9 +346,12 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT) return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY; case PFLAGNUM_4: - return PF4_NOCUSTOMAUTH | PF4_FORCEAUTH | PF4_OFFLINEFILES | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS - | PF4_SERVERMSGID | PF4_DELETEFORALL | PF4_REPLY | PF4_GROUPCHATFILES; - + ret = PF4_NOCUSTOMAUTH | PF4_FORCEAUTH | PF4_OFFLINEFILES | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS + | PF4_SERVERMSGID | PF4_REPLY | PF4_GROUPCHATFILES; + if (GetId(hContact) != m_iOwnId) + ret |= PF4_DELETEFORALL; + return ret; + case PFLAGNUM_5: return PF2_SHORTAWAY | PF2_LONGAWAY; diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index f7ef21a95f..5e71eafedc 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -504,6 +504,8 @@ INT_PTR CTelegramProto::SvcCanEmptyHistory(WPARAM hContact, LPARAM) TG_SUPER_GROUP tmp(pUser->id, 0); if (auto *pGroup = m_arSuperGroups.find(&tmp)) return !pGroup->group->is_channel_; + + return 1; } return 0; -- cgit v1.2.3