Improve ReactionManager::is_active_reaction.

This commit is contained in:
levlam 2023-09-19 15:28:39 +03:00
parent 6e84da54b9
commit b72fa29981

View File

@ -688,12 +688,7 @@ void ReactionManager::on_get_top_reactions(tl_object_ptr<telegram_api::messages_
} }
bool ReactionManager::is_active_reaction(const ReactionType &reaction_type) const { bool ReactionManager::is_active_reaction(const ReactionType &reaction_type) const {
for (auto &supported_reaction : reactions_.reactions_) { return td::contains(active_reaction_types_, reaction_type);
if (supported_reaction.reaction_type_ == reaction_type) {
return supported_reaction.is_active_;
}
}
return false;
} }
void ReactionManager::set_default_reaction(ReactionType reaction_type, Promise<Unit> &&promise) { void ReactionManager::set_default_reaction(ReactionType reaction_type, Promise<Unit> &&promise) {