Do not handle errors of messages.getReplies in channels.
GitOrigin-RevId: f80a65a578fa4ced3596acc635fa6759feb8e844
This commit is contained in:
parent
610443fc22
commit
7d5b47990b
@ -1828,6 +1828,7 @@ class SearchMessagesQuery : public Td::ResultHandler {
|
|||||||
MessageSearchFilter filter_;
|
MessageSearchFilter filter_;
|
||||||
MessageId top_thread_message_id_;
|
MessageId top_thread_message_id_;
|
||||||
int64 random_id_;
|
int64 random_id_;
|
||||||
|
bool handle_errors_ = true;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SearchMessagesQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
explicit SearchMessagesQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||||
@ -1858,6 +1859,8 @@ class SearchMessagesQuery : public Td::ResultHandler {
|
|||||||
telegram_api::messages_getUnreadMentions(std::move(input_peer), from_message_id.get_server_message_id().get(),
|
telegram_api::messages_getUnreadMentions(std::move(input_peer), from_message_id.get_server_message_id().get(),
|
||||||
offset, limit, std::numeric_limits<int32>::max(), 0)));
|
offset, limit, std::numeric_limits<int32>::max(), 0)));
|
||||||
} else if (top_thread_message_id.is_valid() && !sender_user_id.is_valid() && filter == MessageSearchFilter::Empty) {
|
} else if (top_thread_message_id.is_valid() && !sender_user_id.is_valid() && filter == MessageSearchFilter::Empty) {
|
||||||
|
handle_errors_ = dialog_id.get_type() != DialogType::Channel ||
|
||||||
|
td->contacts_manager_->get_channel_type(dialog_id.get_channel_id()) != ChannelType::Broadcast;
|
||||||
send_query(G()->net_query_creator().create(telegram_api::messages_getReplies(
|
send_query(G()->net_query_creator().create(telegram_api::messages_getReplies(
|
||||||
std::move(input_peer), top_thread_message_id.get_server_message_id().get(),
|
std::move(input_peer), top_thread_message_id.get_server_message_id().get(),
|
||||||
from_message_id.get_server_message_id().get(), 0, offset, limit, std::numeric_limits<int32>::max(), 0, 0)));
|
from_message_id.get_server_message_id().get(), 0, offset, limit, std::numeric_limits<int32>::max(), 0, 0)));
|
||||||
@ -1899,7 +1902,9 @@ class SearchMessagesQuery : public Td::ResultHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void on_error(uint64 id, Status status) override {
|
void on_error(uint64 id, Status status) override {
|
||||||
|
if (!handle_errors_) {
|
||||||
td->messages_manager_->on_get_dialog_error(dialog_id_, status, "SearchMessagesQuery");
|
td->messages_manager_->on_get_dialog_error(dialog_id_, status, "SearchMessagesQuery");
|
||||||
|
}
|
||||||
td->messages_manager_->on_failed_dialog_messages_search(dialog_id_, random_id_);
|
td->messages_manager_->on_failed_dialog_messages_search(dialog_id_, random_id_);
|
||||||
promise_.set_error(std::move(status));
|
promise_.set_error(std::move(status));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user