diff options
| author | levlam <levlam@telegram.org> | 2023-08-04 15:32:24 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2023-08-04 15:32:24 +0300 |
| commit | 6acd85411fbd844a2d19a9904c39a462fc426429 (patch) | |
| tree | 619e1bb153a5d0bbf771646988de7de42e2948f7 /td/telegram/StoryInteractionInfo.cpp | |
| parent | ea33e9f2d0420a9f27a13848b478d9863a15f693 (diff) | |
Add storyInteractionInfo.reaction_count.
Diffstat (limited to 'td/telegram/StoryInteractionInfo.cpp')
| -rw-r--r-- | td/telegram/StoryInteractionInfo.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/td/telegram/StoryInteractionInfo.cpp b/td/telegram/StoryInteractionInfo.cpp index e5f6772e0..ed7b1e24d 100644 --- a/td/telegram/StoryInteractionInfo.cpp +++ b/td/telegram/StoryInteractionInfo.cpp @@ -36,6 +36,11 @@ StoryInteractionInfo::StoryInteractionInfo(Td *td, telegram_api::object_ptr<tele LOG(ERROR) << "Receive " << view_count_ << " story views"; view_count_ = 0; } + reaction_count_ = story_views->reactions_count_; + if (reaction_count_ < 0) { + LOG(ERROR) << "Receive " << reaction_count_ << " story reactions"; + reaction_count_ = 0; + } } void StoryInteractionInfo::add_dependencies(Dependencies &dependencies) const { @@ -61,16 +66,18 @@ td_api::object_ptr<td_api::storyInteractionInfo> StoryInteractionInfo::get_story return nullptr; } return td_api::make_object<td_api::storyInteractionInfo>( - view_count_, + view_count_, reaction_count_, td->contacts_manager_->get_user_ids_object(recent_viewer_user_ids_, "get_story_interaction_info_object")); } bool operator==(const StoryInteractionInfo &lhs, const StoryInteractionInfo &rhs) { - return lhs.recent_viewer_user_ids_ == rhs.recent_viewer_user_ids_ && lhs.view_count_ == rhs.view_count_; + return lhs.recent_viewer_user_ids_ == rhs.recent_viewer_user_ids_ && lhs.view_count_ == rhs.view_count_ && + lhs.reaction_count_ == rhs.reaction_count_; } StringBuilder &operator<<(StringBuilder &string_builder, const StoryInteractionInfo &info) { - return string_builder << info.view_count_ << " views by " << info.recent_viewer_user_ids_; + return string_builder << info.view_count_ << " views with " << info.reaction_count_ << " reactions by " + << info.recent_viewer_user_ids_; } } // namespace td |
