From d648ce0b69d55f69342d647c45290a2209fd3e6a Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 26 Jan 2021 03:13:09 +0300 Subject: [PATCH] Remove chatActionImportingMessages. --- td/generate/scheme/td_api.tl | 2 -- td/generate/scheme/td_api.tlo | Bin 195568 -> 195464 bytes td/telegram/DialogAction.cpp | 11 +++++++---- td/telegram/DialogAction.h | 2 ++ td/telegram/MessagesManager.cpp | 7 +++++++ td/telegram/cli.cpp | 3 --- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 145e2e97b..27dfc6dd3 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1971,8 +1971,6 @@ 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 37f89fc4089d1c9049c99f3623d29e609ffcbcea..d51bd584b362fd4ef9b13b29d71d7148139fcebb 100644 GIT binary patch delta 403 zcmezHox9^Z_XZU0Hhki6xH7C7Jno47`&!s!MG4W&5won7!H8L|ID$q~hi= zAs+@HC~{`g;jnEx2ojsz5vPM&@=Tl#3s}{LcoPW2B;EkG@|t)9H03Yi(G3VlKo{AO zfX4-Y@JTu(;?dcXh{vU86470{AV~$M$C~dXZNHPmm@) yPE1cNMhy{*Bo&+?(p-|Xy(Eb-WeO|Uj_DikGs &&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; @@ -258,7 +255,6 @@ tl_object_ptr DialogAction::get_chat_action_object() const { case Type::UploadingVideoNote: return td_api::make_object(progress_); case Type::ImportingMessages: - return td_api::make_object(progress_); case Type::SpeakingInVoiceChat: default: UNREACHABLE(); @@ -363,6 +359,13 @@ DialogAction DialogAction::get_speaking_action() { return DialogAction(Type::SpeakingInVoiceChat, 0); } +int32 DialogAction::get_importing_messages_action_progress() const { + if (type_ != Type::ImportingMessages) { + return -1; + } + return progress_; +} + StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &action) { string_builder << "ChatAction"; const char *type = [action_type = action.type_] { diff --git a/td/telegram/DialogAction.h b/td/telegram/DialogAction.h index 09826b47b..cd33d248a 100644 --- a/td/telegram/DialogAction.h +++ b/td/telegram/DialogAction.h @@ -64,6 +64,8 @@ class DialogAction { static DialogAction get_speaking_action(); + int32 get_importing_messages_action_progress() const; + friend bool operator==(const DialogAction &lhs, const DialogAction &rhs) { return lhs.type_ == rhs.type_ && lhs.progress_ == rhs.progress_; } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 8c5e62315..b8bdadde0 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -7056,6 +7056,13 @@ void MessagesManager::on_user_dialog_action(DialogId dialog_id, MessageId top_th } return; } + { + auto message_import_progress = action.get_importing_messages_action_progress(); + if (message_import_progress >= 0) { + // TODO + return; + } + } if (!td_->contacts_manager_->have_min_user(user_id)) { LOG(DEBUG) << "Ignore typing of unknown " << user_id; diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 3f1f6a634..57f2af242 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1312,9 +1312,6 @@ 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(); }