Add storyViewers.total_reaction_count.
This commit is contained in:
parent
a1b08e2907
commit
0b7914bc18
@ -3155,9 +3155,10 @@ storyViewer user_id:int53 view_date:int32 block_list:BlockList chosen_reaction_t
|
||||
|
||||
//@description Represents a list of story viewers
|
||||
//@total_count Approximate total number of story viewers found
|
||||
//@total_reaction_count Approximate total number of reactions set by found story viewers
|
||||
//@viewers List of story viewers
|
||||
//@next_offset The offset for the next request. If empty, there are no more results
|
||||
storyViewers total_count:int32 viewers:vector<storyViewer> next_offset:string = StoryViewers;
|
||||
storyViewers total_count:int32 total_reaction_count:int32 viewers:vector<storyViewer> next_offset:string = StoryViewers;
|
||||
|
||||
|
||||
//@description Describes position of a clickable rectangle area on a story media
|
||||
|
@ -2533,7 +2533,8 @@ void StoryManager::on_get_story_viewers(
|
||||
view->blocked_my_stories_from_);
|
||||
}
|
||||
|
||||
StoryViewers story_viewers(total_count, std::move(view_list->views_), std::move(view_list->next_offset_));
|
||||
StoryViewers story_viewers(total_count, total_reaction_count, std::move(view_list->views_),
|
||||
std::move(view_list->next_offset_));
|
||||
if (story->content_ != nullptr) {
|
||||
bool is_changed = false;
|
||||
if (is_full && story->interaction_info_.set_counts(total_count, total_reaction_count)) {
|
||||
|
@ -25,9 +25,10 @@ StringBuilder &operator<<(StringBuilder &string_builder, const StoryViewer &view
|
||||
return string_builder << '[' << viewer.user_id_ << " with " << viewer.reaction_type_ << " at " << viewer.date_ << ']';
|
||||
}
|
||||
|
||||
StoryViewers::StoryViewers(int32 total_count, vector<telegram_api::object_ptr<telegram_api::storyView>> &&story_views,
|
||||
StoryViewers::StoryViewers(int32 total_count, int32 total_reaction_count,
|
||||
vector<telegram_api::object_ptr<telegram_api::storyView>> &&story_views,
|
||||
string &&next_offset)
|
||||
: total_count_(total_count), next_offset_(std::move(next_offset)) {
|
||||
: total_count_(total_count), total_reaction_count_(total_reaction_count), next_offset_(std::move(next_offset)) {
|
||||
for (auto &story_view : story_views) {
|
||||
story_viewers_.emplace_back(std::move(story_view));
|
||||
auto user_id = story_viewers_.back().get_user_id();
|
||||
@ -45,7 +46,7 @@ vector<UserId> StoryViewers::get_user_ids() const {
|
||||
td_api::object_ptr<td_api::storyViewers> StoryViewers::get_story_viewers_object(
|
||||
ContactsManager *contacts_manager) const {
|
||||
return td_api::make_object<td_api::storyViewers>(
|
||||
total_count_,
|
||||
total_count_, total_reaction_count_,
|
||||
transform(story_viewers_,
|
||||
[contacts_manager](const StoryViewer &story_viewer) {
|
||||
return story_viewer.get_story_viewer_object(contacts_manager);
|
||||
|
@ -47,14 +47,15 @@ StringBuilder &operator<<(StringBuilder &string_builder, const StoryViewer &view
|
||||
|
||||
class StoryViewers {
|
||||
int32 total_count_ = 0;
|
||||
int32 total_reaction_count_ = 0;
|
||||
vector<StoryViewer> story_viewers_;
|
||||
string next_offset_;
|
||||
|
||||
friend StringBuilder &operator<<(StringBuilder &string_builder, const StoryViewers &viewers);
|
||||
|
||||
public:
|
||||
StoryViewers(int32 total_count, vector<telegram_api::object_ptr<telegram_api::storyView>> &&story_views,
|
||||
string &&next_offset);
|
||||
StoryViewers(int32 total_count, int32 total_reaction_count,
|
||||
vector<telegram_api::object_ptr<telegram_api::storyView>> &&story_views, string &&next_offset);
|
||||
|
||||
vector<UserId> get_user_ids() const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user