Add td_api::searchMessagesFilterUnreadReaction.
This commit is contained in:
parent
e7406475ff
commit
fd8d15e2d2
@ -2117,6 +2117,9 @@ searchMessagesFilterMention = SearchMessagesFilter;
|
||||
//@description Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
|
||||
searchMessagesFilterUnreadMention = SearchMessagesFilter;
|
||||
|
||||
//@description Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
|
||||
searchMessagesFilterUnreadReaction = SearchMessagesFilter;
|
||||
|
||||
//@description Returns only failed to send messages. This filter can be used only if the message database is used
|
||||
searchMessagesFilterFailedToSend = SearchMessagesFilter;
|
||||
|
||||
@ -4373,7 +4376,7 @@ searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_messa
|
||||
//@offset_chat_id The chat identifier of the last found message, or 0 for the first request
|
||||
//@offset_message_id The message identifier of the last found message, or 0 for the first request
|
||||
//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
|
||||
//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterFailedToSend and searchMessagesFilterPinned are unsupported in this function
|
||||
//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function
|
||||
//@min_date If not 0, the minimum date of the messages to return
|
||||
//@max_date If not 0, the maximum date of the messages to return
|
||||
searchMessages chat_list:ChatList query:string offset_date:int32 offset_chat_id:int53 offset_message_id:int53 limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = Messages;
|
||||
@ -4406,14 +4409,14 @@ getChatMessageByDate chat_id:int53 date:int32 = Message;
|
||||
//@description Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id).
|
||||
//-Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database
|
||||
//@chat_id Identifier of the chat in which to return information about message positions
|
||||
//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function
|
||||
//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
|
||||
//@from_message_id The message identifier from which to return information about message positions
|
||||
//@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages
|
||||
getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 limit:int32 = MessagePositions;
|
||||
|
||||
//@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset"
|
||||
//@chat_id Identifier of the chat in which to return information about messages
|
||||
//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention and searchMessagesFilterUnreadMention are unsupported in this function
|
||||
//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
|
||||
//@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message
|
||||
getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar;
|
||||
|
||||
|
@ -91,6 +91,8 @@ MessageSearchFilter get_message_search_filter(const tl_object_ptr<td_api::Search
|
||||
return MessageSearchFilter::FailedToSend;
|
||||
case td_api::searchMessagesFilterPinned::ID:
|
||||
return MessageSearchFilter::Pinned;
|
||||
case td_api::searchMessagesFilterUnreadReaction::ID:
|
||||
return MessageSearchFilter::UnreadReaction;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return MessageSearchFilter::Empty;
|
||||
|
@ -2356,6 +2356,10 @@ class SearchMessagesQuery final : public Td::ResultHandler {
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::messages_getUnreadMentions(std::move(input_peer), from_message_id.get_server_message_id().get(),
|
||||
offset, limit, std::numeric_limits<int32>::max(), 0)));
|
||||
} else if (filter == MessageSearchFilter::UnreadReaction) {
|
||||
send_query(G()->net_query_creator().create(telegram_api::messages_getUnreadReactions(
|
||||
std::move(input_peer), from_message_id.get_server_message_id().get(), offset, limit,
|
||||
std::numeric_limits<int32>::max(), 0)));
|
||||
} else if (top_thread_message_id.is_valid() && query.empty() && !sender_dialog_id.is_valid() &&
|
||||
filter == MessageSearchFilter::Empty) {
|
||||
handle_errors_ = dialog_id.get_type() != DialogType::Channel ||
|
||||
@ -2388,6 +2392,9 @@ class SearchMessagesQuery final : public Td::ResultHandler {
|
||||
static_assert(std::is_same<telegram_api::messages_getUnreadMentions::ReturnType,
|
||||
telegram_api::messages_search::ReturnType>::value,
|
||||
"");
|
||||
static_assert(std::is_same<telegram_api::messages_getUnreadReactions::ReturnType,
|
||||
telegram_api::messages_search::ReturnType>::value,
|
||||
"");
|
||||
static_assert(
|
||||
std::is_same<telegram_api::messages_getReplies::ReturnType, telegram_api::messages_search::ReturnType>::value,
|
||||
"");
|
||||
@ -22899,7 +22906,8 @@ std::pair<int32, vector<FullMessageId>> MessagesManager::search_messages(
|
||||
|
||||
CHECK(filter != MessageSearchFilter::Call && filter != MessageSearchFilter::MissedCall);
|
||||
if (filter == MessageSearchFilter::Mention || filter == MessageSearchFilter::UnreadMention ||
|
||||
filter == MessageSearchFilter::FailedToSend || filter == MessageSearchFilter::Pinned) {
|
||||
filter == MessageSearchFilter::UnreadReaction || filter == MessageSearchFilter::FailedToSend ||
|
||||
filter == MessageSearchFilter::Pinned) {
|
||||
promise.set_error(Status::Error(400, "The filter is not supported"));
|
||||
return {};
|
||||
}
|
||||
@ -23157,7 +23165,8 @@ void MessagesManager::get_dialog_sparse_message_positions(
|
||||
|
||||
CHECK(filter != MessageSearchFilter::Call && filter != MessageSearchFilter::MissedCall);
|
||||
if (filter == MessageSearchFilter::Empty || filter == MessageSearchFilter::Mention ||
|
||||
filter == MessageSearchFilter::UnreadMention || filter == MessageSearchFilter::Pinned) {
|
||||
filter == MessageSearchFilter::UnreadMention || filter == MessageSearchFilter::UnreadReaction ||
|
||||
filter == MessageSearchFilter::Pinned) {
|
||||
return promise.set_error(Status::Error(400, "The filter is not supported"));
|
||||
}
|
||||
|
||||
|
@ -1218,6 +1218,9 @@ class CliClient final : public Actor {
|
||||
if (filter == "um" || filter == "umention") {
|
||||
return td_api::make_object<td_api::searchMessagesFilterUnreadMention>();
|
||||
}
|
||||
if (filter == "ur" || filter == "ureaction") {
|
||||
return td_api::make_object<td_api::searchMessagesFilterUnreadReaction>();
|
||||
}
|
||||
if (filter == "f" || filter == "failed") {
|
||||
return td_api::make_object<td_api::searchMessagesFilterFailedToSend>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user