Add MessageReactions::get_message_reactions_object.
This commit is contained in:
parent
c9f7603ad7
commit
da00ea6f86
|
@ -797,6 +797,13 @@ bool MessageReactions::are_consistent_with_list(const string &reaction, FlatHash
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vector<td_api::object_ptr<td_api::messageReaction>> MessageReactions::get_message_reactions_object(
|
||||||
|
Td *td, UserId my_user_id, UserId peer_user_id) const {
|
||||||
|
return transform(reactions_, [td, my_user_id, peer_user_id](const MessageReaction &reaction) {
|
||||||
|
return reaction.get_message_reaction_object(td, my_user_id, peer_user_id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bool MessageReactions::need_update_message_reactions(const MessageReactions *old_reactions,
|
bool MessageReactions::need_update_message_reactions(const MessageReactions *old_reactions,
|
||||||
const MessageReactions *new_reactions) {
|
const MessageReactions *new_reactions) {
|
||||||
if (old_reactions == nullptr) {
|
if (old_reactions == nullptr) {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "td/telegram/MinChannel.h"
|
#include "td/telegram/MinChannel.h"
|
||||||
#include "td/telegram/td_api.h"
|
#include "td/telegram/td_api.h"
|
||||||
#include "td/telegram/telegram_api.h"
|
#include "td/telegram/telegram_api.h"
|
||||||
|
#include "td/telegram/UserId.h"
|
||||||
|
|
||||||
#include "td/utils/common.h"
|
#include "td/utils/common.h"
|
||||||
#include "td/utils/FlatHashMap.h"
|
#include "td/utils/FlatHashMap.h"
|
||||||
|
@ -169,6 +170,9 @@ struct MessageReactions {
|
||||||
bool are_consistent_with_list(const string &reaction, FlatHashMap<string, vector<DialogId>> reactions,
|
bool are_consistent_with_list(const string &reaction, FlatHashMap<string, vector<DialogId>> reactions,
|
||||||
int32 total_count) const;
|
int32 total_count) const;
|
||||||
|
|
||||||
|
vector<td_api::object_ptr<td_api::messageReaction>> get_message_reactions_object(Td *td, UserId my_user_id,
|
||||||
|
UserId peer_user_id) const;
|
||||||
|
|
||||||
static bool need_update_message_reactions(const MessageReactions *old_reactions,
|
static bool need_update_message_reactions(const MessageReactions *old_reactions,
|
||||||
const MessageReactions *new_reactions);
|
const MessageReactions *new_reactions);
|
||||||
|
|
||||||
|
|
|
@ -6936,10 +6936,7 @@ td_api::object_ptr<td_api::messageInteractionInfo> MessagesManager::get_message_
|
||||||
my_user_id = td_->contacts_manager_->get_my_id();
|
my_user_id = td_->contacts_manager_->get_my_id();
|
||||||
peer_user_id = dialog_id.get_user_id();
|
peer_user_id = dialog_id.get_user_id();
|
||||||
}
|
}
|
||||||
reactions =
|
reactions = m->reactions->get_message_reactions_object(td_, my_user_id, peer_user_id);
|
||||||
transform(m->reactions->reactions_, [td = td_, my_user_id, peer_user_id](const MessageReaction &reaction) {
|
|
||||||
return reaction.get_message_reaction_object(td, my_user_id, peer_user_id);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return td_api::make_object<td_api::messageInteractionInfo>(m->view_count, m->forward_count, std::move(reply_info),
|
return td_api::make_object<td_api::messageInteractionInfo>(m->view_count, m->forward_count, std::move(reply_info),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user