From 54015a18421e3366724b1956478f66bf7c4a01e8 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 4 Jun 2024 12:51:55 +0300 Subject: [PATCH] Add clearSearchedForHashtags.clear_cashtags. --- td/generate/scheme/td_api.tl | 4 ++-- td/telegram/Td.cpp | 3 ++- td/telegram/cli.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 856bc6c6d..d093d307b 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -8077,8 +8077,8 @@ getSearchedForHashtags prefix:string limit:int32 = Hashtags; //@description Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags @hashtag Hashtag or cashtag to delete removeSearchedForHashtag hashtag:string = Ok; -//@description Clears the list of recently searched for hashtags -clearSearchedForHashtags = Ok; +//@description Clears the list of recently searched for hashtags or cashtags @clear_cashtags Pass true to clear the list of recently searched for cashtags; otherwise the list of recently searched for hashtags will be cleared +clearSearchedForHashtags clear_cashtags:Bool = Ok; //@description Deletes all call messages @revoke Pass true to delete the messages for all users deleteAllCallMessages revoke:Bool = Ok; diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index a607f29f6..a21437519 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -5341,7 +5341,8 @@ void Td::on_request(uint64 id, td_api::removeSearchedForHashtag &request) { void Td::on_request(uint64 id, td_api::clearSearchedForHashtags &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); - send_closure(hashtag_search_hints_, &HashtagHints::clear, std::move(promise)); + send_closure(request.clear_cashtags_ ? cashtag_search_hints_ : hashtag_search_hints_, &HashtagHints::clear, + std::move(promise)); } void Td::on_request(uint64 id, const td_api::deleteAllCallMessages &request) { diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 265aeeef9..a8e212d18 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3073,8 +3073,8 @@ class CliClient final : public Actor { string hashtag; get_args(args, hashtag); send_request(td_api::make_object(hashtag)); - } else if (op == "csfh") { - send_request(td_api::make_object()); + } else if (op == "csfh" || op == "csfc") { + send_request(td_api::make_object(op == "csfc")); } else if (op == "DeleteAllCallMessages") { bool revoke = as_bool(args); send_request(td_api::make_object(revoke));