Make MessageViewers fields private.

This commit is contained in:
levlam 2023-06-28 21:35:59 +03:00
parent 3a3ae9eabf
commit 26a0d109c2
2 changed files with 5 additions and 3 deletions

View File

@ -48,9 +48,12 @@ bool operator!=(const MessageViewer &lhs, const MessageViewer &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const MessageViewer &viewer); StringBuilder &operator<<(StringBuilder &string_builder, const MessageViewer &viewer);
struct MessageViewers { class MessageViewers {
vector<MessageViewer> message_viewers_; vector<MessageViewer> message_viewers_;
friend StringBuilder &operator<<(StringBuilder &string_builder, const MessageViewers &viewers);
public:
MessageViewers() = default; MessageViewers() = default;
explicit MessageViewers(vector<telegram_api::object_ptr<telegram_api::storyView>> &&story_views); explicit MessageViewers(vector<telegram_api::object_ptr<telegram_api::storyView>> &&story_views);

View File

@ -18200,8 +18200,7 @@ void MessagesManager::on_get_message_viewers(DialogId dialog_id, MessageViewers
Promise<td_api::object_ptr<td_api::messageViewers>> &&promise) { Promise<td_api::object_ptr<td_api::messageViewers>> &&promise) {
if (!is_recursive) { if (!is_recursive) {
bool need_participant_list = false; bool need_participant_list = false;
for (auto message_viewer : message_viewers.message_viewers_) { for (auto user_id : message_viewers.get_user_ids()) {
auto user_id = message_viewer.get_user_id();
if (!user_id.is_valid()) { if (!user_id.is_valid()) {
LOG(ERROR) << "Receive invalid " << user_id << " as viewer of a message in " << dialog_id; LOG(ERROR) << "Receive invalid " << user_id << " as viewer of a message in " << dialog_id;
continue; continue;