diff --git a/td/telegram/MessageReaction.cpp b/td/telegram/MessageReaction.cpp index 32643dec1..dcf3a271f 100644 --- a/td/telegram/MessageReaction.cpp +++ b/td/telegram/MessageReaction.cpp @@ -805,6 +805,15 @@ vector> MessageReactions::get_messag }); } +void MessageReactions::add_min_channels(Td *td) const { + for (const auto &reaction : reactions_) { + for (const auto &recent_chooser_min_channel : reaction.get_recent_chooser_min_channels()) { + LOG(INFO) << "Add min reacted " << recent_chooser_min_channel.first; + td->contacts_manager_->add_min_channel(recent_chooser_min_channel.first, recent_chooser_min_channel.second); + } + } +} + void MessageReactions::add_dependencies(Dependencies &dependencies) const { for (const auto &reaction : reactions_) { const auto &dialog_ids = reaction.get_recent_chooser_dialog_ids(); diff --git a/td/telegram/MessageReaction.h b/td/telegram/MessageReaction.h index 9a84cf6bb..8552d6472 100644 --- a/td/telegram/MessageReaction.h +++ b/td/telegram/MessageReaction.h @@ -175,6 +175,8 @@ struct MessageReactions { vector> get_message_reactions_object(Td *td, UserId my_user_id, UserId peer_user_id) const; + void add_min_channels(Td *td) const; + void add_dependencies(Dependencies &dependencies) const; static bool need_update_message_reactions(const MessageReactions *old_reactions, diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 5c197418e..64a01fdca 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -25500,12 +25500,7 @@ void MessagesManager::add_message_dependencies(Dependencies &dependencies, const dependencies.add_dialog_dependencies(recent_replier_dialog_id); } if (m->reactions != nullptr) { - for (const auto &reaction : m->reactions->reactions_) { - for (const auto &recent_chooser_min_channel : reaction.get_recent_chooser_min_channels()) { - LOG(INFO) << "Add min reacted " << recent_chooser_min_channel.first; - td_->contacts_manager_->add_min_channel(recent_chooser_min_channel.first, recent_chooser_min_channel.second); - } - } + m->reactions->add_min_channels(td_); m->reactions->add_dependencies(dependencies); } add_message_content_dependencies(dependencies, m->content.get());