From b54554c79eb9418124bf98309da83adec1ecbc5e Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 21 Jan 2021 01:50:21 +0300 Subject: [PATCH] Add chatActionImportingMessages. --- td/generate/scheme/td_api.tl | 2 ++ td/generate/scheme/td_api.tlo | Bin 194580 -> 194684 bytes td/telegram/DialogAction.cpp | 16 ++++++++++++++++ td/telegram/DialogAction.h | 3 ++- td/telegram/cli.cpp | 3 +++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 3a422a0a4..43945ff4b 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1963,6 +1963,8 @@ chatActionStartPlayingGame = ChatAction; chatActionRecordingVideoNote = ChatAction; //@description The user is uploading a video note @progress Upload progress, as a percentage chatActionUploadingVideoNote progress:int32 = ChatAction; +//@description The user is importing message history. This action is sent automatically and can't be explicitly sent @progress Import progress, as a percentage +chatActionImportingMessages progress:int32 = ChatAction; //@description The user has cancelled the previous action chatActionCancel = ChatAction; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index c46745ef72ec62a52f9404d667a4730cdd539dc3..6544a6a0d5fe07f1e438eb97c6dd57c355b2af33 100644 GIT binary patch delta 454 zcmbR8f&0$~?hPtzf}tnx3vfASB$hZPmt^MWG4M^E$RxhmhwX|kW7=j#6J;$4kcykf zgnSr)pvaj`hr_n*AV_R-Oq>pG$pvvbEMQd^;!Ge6j(7vy$^+sJ(3J0qM>jwv0bQgg z0gnqV;FA wPE1cNMhy|3Bo&+?((IA6-6M&yWfC}8wqN+dm~jrwoPI!uNnv};VWu4>0RK6u$p8QV delta 404 zcmezKfqTja?hPtzg6!2!)47~85=$JDOEUBG7qXv+7*qZ^=-fG*OL zfX4+F@JWg!;?WtAh{vT1646~+lB9yuW6c|qwr@ycY?;Ig3JiwnjgJ`>wnu(tbUz0b PFw|m_-+tsU(+(2=!0v-& diff --git a/td/telegram/DialogAction.cpp b/td/telegram/DialogAction.cpp index d4b9f8a64..e6091b81a 100644 --- a/td/telegram/DialogAction.cpp +++ b/td/telegram/DialogAction.cpp @@ -79,6 +79,9 @@ DialogAction::DialogAction(tl_object_ptr &&action) { init(Type::UploadingVideoNote, uploading_action->progress_); break; } + case td_api::chatActionImportingMessages::ID: + init(Type::Cancel); // it can't be sent explicitly + break; default: UNREACHABLE(); break; @@ -139,6 +142,11 @@ DialogAction::DialogAction(tl_object_ptr &&acti case telegram_api::speakingInGroupCallAction::ID: init(Type::SpeakingInVoiceChat); break; + case telegram_api::sendMessageHistoryImportAction::ID: { + auto history_import_action = move_tl_object_as(action); + init(Type::ImportingMessages, history_import_action->progress_); + break; + } default: UNREACHABLE(); break; @@ -175,6 +183,8 @@ tl_object_ptr DialogAction::get_input_send_mess return make_tl_object(progress_); case Type::SpeakingInVoiceChat: return make_tl_object(); + case Type::ImportingMessages: + return make_tl_object(progress_); default: UNREACHABLE(); return nullptr; @@ -211,6 +221,8 @@ tl_object_ptr DialogAction::get_secret_input_send return make_tl_object(); case Type::SpeakingInVoiceChat: return make_tl_object(); + case Type::ImportingMessages: + return make_tl_object(); default: UNREACHABLE(); return nullptr; @@ -245,6 +257,8 @@ tl_object_ptr DialogAction::get_chat_action_object() const { return td_api::make_object(); case Type::UploadingVideoNote: return td_api::make_object(progress_); + case Type::ImportingMessages: + return td_api::make_object(progress_); case Type::SpeakingInVoiceChat: default: UNREACHABLE(); @@ -381,6 +395,8 @@ StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &act return "UploadingVideoNote"; case DialogAction::Type::SpeakingInVoiceChat: return "SpeakingInVoiceChat"; + case DialogAction::Type::ImportingMessages: + return "ImportingMessages"; default: UNREACHABLE(); return "Cancel"; diff --git a/td/telegram/DialogAction.h b/td/telegram/DialogAction.h index 0d457a7d7..09826b47b 100644 --- a/td/telegram/DialogAction.h +++ b/td/telegram/DialogAction.h @@ -31,7 +31,8 @@ class DialogAction { StartPlayingGame, RecordingVideoNote, UploadingVideoNote, - SpeakingInVoiceChat + SpeakingInVoiceChat, + ImportingMessages }; Type type_ = Type::Cancel; int32 progress_ = 0; diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 32204b328..ec9a5abe0 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1310,6 +1310,9 @@ class CliClient final : public Actor { if (action == "uvn" || action == "upload_video_note") { return td_api::make_object(50); } + if (action == "im" || action == "import_messages") { + return td_api::make_object(50); + } return td_api::make_object(); }