From 71a1103f8a902a82f2215932ecb3c1a06e74718e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Nov 2024 14:30:35 +0300 Subject: =?UTF-8?q?fixes=20#4769=20(Telegram:=20=D0=BF=D0=BE=D0=BA=D0=B0?= =?UTF-8?q?=D0=B7=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B2=D1=81=D0=BF=D0=BB?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D1=8E=D1=89=D0=B5=D0=B5=20=D0=BE=D0=BA=D0=BD?= =?UTF-8?q?=D0=BE=20=D1=81=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8=20AUTH=5FKEY=5FDROP=5FDUPLICATE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/proto.h | 1 + protocols/Telegram/src/server.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index 3b47eb22c0..f79a7f6028 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -279,6 +279,7 @@ class CTelegramProto : public PROTO void ProcessOption(TD::updateOption *pObj); void ProcessRemoteMarkRead(TD::updateChatReadOutbox *pObj); void ProcessScopeNotification(TD::updateScopeNotificationSettings *pObj); + void ProcessServiceNotification(TD::updateServiceNotification *pObj); void ProcessStatus(TD::updateUserStatus *pObj); void ProcessSuperGroup(TD::updateSupergroup *pObj); void ProcessSuperGroupInfo(TD::updateSupergroupFullInfo *pObj); diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index a8e6e23b59..9303509442 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -326,6 +326,10 @@ void CTelegramProto::ProcessResponse(td::ClientManager::Response response) ProcessScopeNotification((TD::updateScopeNotificationSettings *)response.object.get()); break; + case TD::updateServiceNotification::ID: + ProcessServiceNotification((TD::updateServiceNotification *)response.object.get()); + break; + case TD::updateSupergroup::ID: ProcessSuperGroup((TD::updateSupergroup *)response.object.get()); break; @@ -1159,6 +1163,18 @@ void CTelegramProto::ProcessScopeNotification(TD::updateScopeNotificationSetting } } +void CTelegramProto::ProcessServiceNotification(TD::updateServiceNotification *pObj) +{ + if (pObj->content_->get_id() != TD::messageText::ID) { + debugLogA("Expected type %d, but got %d, ignored", TD::messageText::ID, pObj->content_->get_id()); + return; + } + + auto *pMessageText = (TD::messageText *)pObj->content_.get(); + CMStringA szMessage(GetFormattedText(pMessageText->text_)); + Popup(0, Utf2T(szMessage), TranslateT("Service notification")); +} + ///////////////////////////////////////////////////////////////////////////////////////// void CTelegramProto::ProcessStatus(TD::updateUserStatus *pObj) -- cgit v1.2.3