diff options
author | George Hazan <george.hazan@gmail.com> | 2024-11-04 14:30:35 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-11-04 14:30:35 +0300 |
commit | 71a1103f8a902a82f2215932ecb3c1a06e74718e (patch) | |
tree | f6283e1b3177c85255d6e91a11298ce09fe481ae | |
parent | 1f56c2625794b54dacb3f19a7a1cb8c6315e7aa0 (diff) |
fixes #4769 (Telegram: показывать всплывающее окно с ошибкой при получении AUTH_KEY_DROP_DUPLICATE)
-rw-r--r-- | protocols/Telegram/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/Telegram/src/server.cpp | 16 |
2 files changed, 17 insertions, 0 deletions
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<CTelegramProto> 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)
|