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 c46745ef7..6544a6a0d 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ 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(); }