From efc8291dafe68435480bb5dd378cf26ee62d042f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Nov 2024 17:24:43 +0300 Subject: =?UTF-8?q?fixes=20#4641=20(Telegram:=20=D1=83=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=20=D1=81=D0=B5=D1=80=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=20=D1=87=D1=83=D0=B6=D0=B8=D1=85=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B3=D1=80?= =?UTF-8?q?=D1=83=D0=BF=D1=87=D0=B0=D1=82=D0=B0,=20=D0=B5=D1=81=D0=BB?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=20=D0=9C=D0=B8=D1=80=D0=B0=D0=BD=D0=B4=D1=8B?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=BC=D0=BE=D0=B4=D0=B5=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80/=D0=B2=D0=BB=D0=B0=D0=B4=D0=B5=D0=BB=D0=B5=D1=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/proto.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'protocols/Telegram/src/proto.cpp') diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index 73834415b8..a61d72b6ba 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -349,21 +349,12 @@ int CTelegramProto::AuthRequest(MCONTACT hContact, const wchar_t *) 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; case PFLAGNUM_2: return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY; - - case PFLAGNUM_4: - ret = PF4_NOCUSTOMAUTH | PF4_FORCEAUTH | PF4_OFFLINEFILES | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS - | PF4_SERVERMSGID | PF4_REPLY | PF4_GROUPCHATFILES | PF4_IMSENDOFFLINE | PF4_SERVERFORMATTING; - if (GetId(hContact) != m_iOwnId) - ret |= PF4_DELETEFORALL; - return ret; case PFLAGNUM_5: return PF2_SHORTAWAY | PF2_LONGAWAY; @@ -371,9 +362,17 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT hContact) case PFLAG_UNIQUEIDTEXT: return (INT_PTR)L"ID"; - default: - return 0; + case PFLAGNUM_4: + uint32_t ret = PF4_NOCUSTOMAUTH | PF4_FORCEAUTH | PF4_OFFLINEFILES | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS + | PF4_SERVERMSGID | PF4_REPLY | PF4_GROUPCHATFILES | PF4_IMSENDOFFLINE | PF4_SERVERFORMATTING; + + if (GetId(hContact) != m_iOwnId) + ret |= PF4_DELETEFORALL; + + return ret; } + + return 0; } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3