Add searchSavedMessages.saved_messages_topic.

This commit is contained in:
levlam 2024-02-01 13:09:01 +03:00
parent 0e16c0af02
commit f11c4e8af4
3 changed files with 6 additions and 5 deletions

View File

@ -7358,13 +7358,14 @@ searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter
//@description Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only.
//-Returns the results in reverse chronological order, i.e. in order of decreasing message_id
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@saved_messages_topic If not null, only messages in the specified Saved Messages topic will be considered; pass null to consider all messages
//@tag Tag to search for; pass null to return all suitable messages
//@query Query to search for
//@from_message_id Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message
//@offset Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset.
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
searchSavedMessages tag:ReactionType query:string from_message_id:int53 offset:int32 limit:int32 = FoundChatMessages;
searchSavedMessages saved_messages_topic:SavedMessagesTopic tag:ReactionType query:string from_message_id:int53 offset:int32 limit:int32 = FoundChatMessages;
//@description Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results

View File

@ -5337,8 +5337,8 @@ void Td::on_request(uint64 id, td_api::searchSavedMessages &request) {
CHECK_IS_USER();
CLEAN_INPUT_STRING(request.query_);
CREATE_REQUEST(SearchChatMessagesRequest, dialog_manager_->get_my_dialog_id().get(), std::move(request.query_),
nullptr, request.from_message_id_, request.offset_, request.limit_, nullptr, 0, SavedMessagesTopicId(),
ReactionType(request.tag_));
nullptr, request.from_message_id_, request.offset_, request.limit_, nullptr, 0,
SavedMessagesTopicId(this, request.saved_messages_topic_), ReactionType(request.tag_));
}
void Td::on_request(uint64 id, const td_api::searchCallMessages &request) {

View File

@ -2986,8 +2986,8 @@ class CliClient final : public Actor {
int32 offset;
SearchQuery query;
get_args(args, tag, from_message_id, offset, query);
send_request(td_api::make_object<td_api::searchSavedMessages>(as_reaction_type(tag), query.query, from_message_id,
offset, query.limit));
send_request(td_api::make_object<td_api::searchSavedMessages>(get_saved_messages_topic(), as_reaction_type(tag),
query.query, from_message_id, offset, query.limit));
} else if (op == "gcmbd") {
ChatId chat_id;
int32 date;