mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-25 10:01:00 +00:00
Added api support of reactions count for recent posts in statistics.
This commit is contained in:
parent
0865776d9a
commit
69b9d404c0
@ -67,16 +67,18 @@ constexpr auto kCheckRequestsTimer = 10 * crl::time(1000);
|
||||
data.vrecent_posts_interactions().v
|
||||
) | ranges::views::transform([&](const Recent &tl) {
|
||||
return tl.match([&](const MTPDpostInteractionCountersStory &data) {
|
||||
return Data::StatisticsMessageInteractionInfo{ // #TODO
|
||||
.messageId = data.vstory_id().v,
|
||||
return Data::StatisticsMessageInteractionInfo{
|
||||
.storyId = data.vstory_id().v,
|
||||
.viewsCount = data.vviews().v,
|
||||
.forwardsCount = data.vforwards().v,
|
||||
.reactionsCount = data.vreactions().v,
|
||||
};
|
||||
}, [&](const MTPDpostInteractionCountersMessage &data) {
|
||||
return Data::StatisticsMessageInteractionInfo{
|
||||
.messageId = data.vmsg_id().v,
|
||||
.viewsCount = data.vviews().v,
|
||||
.forwardsCount = data.vforwards().v,
|
||||
.reactionsCount = data.vreactions().v,
|
||||
};
|
||||
});
|
||||
}) | ranges::to_vector;
|
||||
@ -88,6 +90,8 @@ constexpr auto kCheckRequestsTimer = 10 * crl::time(1000);
|
||||
.memberCount = StatisticalValueFromTL(data.vfollowers()),
|
||||
.meanViewCount = StatisticalValueFromTL(data.vviews_per_post()),
|
||||
.meanShareCount = StatisticalValueFromTL(data.vshares_per_post()),
|
||||
.meanReactionCount = StatisticalValueFromTL(
|
||||
data.vreactions_per_post()),
|
||||
|
||||
.enabledNotificationsPercentage = unmuted,
|
||||
|
||||
|
@ -13,6 +13,7 @@ namespace Data {
|
||||
|
||||
struct StatisticsMessageInteractionInfo final {
|
||||
MsgId messageId;
|
||||
StoryId storyId = StoryId(0);
|
||||
int viewsCount = 0;
|
||||
int forwardsCount = 0;
|
||||
int reactionsCount = 0;
|
||||
@ -56,6 +57,7 @@ struct ChannelStatistics final {
|
||||
StatisticalValue memberCount;
|
||||
StatisticalValue meanViewCount;
|
||||
StatisticalValue meanShareCount;
|
||||
StatisticalValue meanReactionCount;
|
||||
|
||||
float64 enabledNotificationsPercentage = 0.;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user