Don't keep setTyping query reference for bots.

This commit is contained in:
levlam 2022-01-03 08:01:26 +03:00
parent ad431a612e
commit c075ad7b00
1 changed files with 9 additions and 4 deletions

View File

@ -31771,14 +31771,19 @@ void MessagesManager::send_dialog_action(DialogId dialog_id, MessageId top_threa
return;
}
auto new_query_ref =
td_->create_handler<SetTypingQuery>(std::move(promise))
->send(dialog_id, std::move(input_peer), top_thread_message_id, action.get_input_send_message_action());
if (td_->auth_manager_->is_bot()) {
return;
}
auto &query_ref = set_typing_query_[dialog_id];
if (!query_ref.empty() && !td_->auth_manager_->is_bot()) {
if (!query_ref.empty()) {
LOG(INFO) << "Cancel previous send chat action query";
cancel_query(query_ref);
}
query_ref =
td_->create_handler<SetTypingQuery>(std::move(promise))
->send(dialog_id, std::move(input_peer), top_thread_message_id, action.get_input_send_message_action());
query_ref = std::move(new_query_ref);
}
void MessagesManager::after_set_typing_query(DialogId dialog_id, int32 generation) {