2023-04-26 20:26:30 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-09-29 13:32:07 +00:00
|
|
|
#include "data/data_statistics_chart.h"
|
2023-05-02 14:31:56 +00:00
|
|
|
|
2023-04-26 20:26:30 +00:00
|
|
|
namespace Data {
|
|
|
|
|
|
|
|
struct StatisticsMessageInteractionInfo final {
|
|
|
|
MsgId messageId;
|
|
|
|
int viewsCount = 0;
|
|
|
|
int forwardsCount = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StatisticsMessageSenderInfo final {
|
|
|
|
UserId userId = UserId(0);
|
|
|
|
int sentMessageCount = 0;
|
|
|
|
int averageCharacterCount = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StatisticsAdministratorActionsInfo final {
|
|
|
|
UserId userId = UserId(0);
|
|
|
|
int deletedMessageCount = 0;
|
|
|
|
int bannedUserCount = 0;
|
|
|
|
int restrictedUserCount = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StatisticsInviterInfo final {
|
|
|
|
UserId userId = UserId(0);
|
|
|
|
int addedMemberCount = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StatisticalValue final {
|
|
|
|
float64 value = 0.;
|
|
|
|
float64 previousValue = 0.;
|
|
|
|
float64 growthRatePercentage = 0.;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ChannelStatistics final {
|
|
|
|
[[nodiscard]] bool empty() const {
|
|
|
|
return !startDate || !endDate;
|
|
|
|
}
|
|
|
|
[[nodiscard]] explicit operator bool() const {
|
|
|
|
return !empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
int startDate = 0;
|
|
|
|
int endDate = 0;
|
|
|
|
|
|
|
|
StatisticalValue memberCount;
|
|
|
|
StatisticalValue meanViewCount;
|
|
|
|
StatisticalValue meanShareCount;
|
|
|
|
|
|
|
|
float64 enabledNotificationsPercentage = 0.;
|
|
|
|
|
|
|
|
StatisticalGraph memberCountGraph;
|
|
|
|
StatisticalGraph joinGraph;
|
|
|
|
StatisticalGraph muteGraph;
|
|
|
|
StatisticalGraph viewCountByHourGraph;
|
|
|
|
StatisticalGraph viewCountBySourceGraph;
|
|
|
|
StatisticalGraph joinBySourceGraph;
|
|
|
|
StatisticalGraph languageGraph;
|
|
|
|
StatisticalGraph messageInteractionGraph;
|
|
|
|
StatisticalGraph instantViewInteractionGraph;
|
|
|
|
|
|
|
|
std::vector<StatisticsMessageInteractionInfo> recentMessageInteractions;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SupergroupStatistics final {
|
|
|
|
[[nodiscard]] bool empty() const {
|
|
|
|
return !startDate || !endDate;
|
|
|
|
}
|
|
|
|
[[nodiscard]] explicit operator bool() const {
|
|
|
|
return !empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
int startDate = 0;
|
|
|
|
int endDate = 0;
|
|
|
|
|
|
|
|
StatisticalValue memberCount;
|
|
|
|
StatisticalValue messageCount;
|
|
|
|
StatisticalValue viewerCount;
|
|
|
|
StatisticalValue senderCount;
|
|
|
|
|
|
|
|
StatisticalGraph memberCountGraph;
|
|
|
|
StatisticalGraph joinGraph;
|
|
|
|
StatisticalGraph joinBySourceGraph;
|
|
|
|
StatisticalGraph languageGraph;
|
|
|
|
StatisticalGraph messageContentGraph;
|
|
|
|
StatisticalGraph actionGraph;
|
|
|
|
StatisticalGraph dayGraph;
|
|
|
|
StatisticalGraph weekGraph;
|
|
|
|
|
|
|
|
std::vector<StatisticsMessageSenderInfo> topSenders;
|
|
|
|
std::vector<StatisticsAdministratorActionsInfo> topAdministrators;
|
|
|
|
std::vector<StatisticsInviterInfo> topInviters;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2023-10-09 14:10:43 +00:00
|
|
|
struct MessageStatistics final {
|
|
|
|
explicit operator bool() const {
|
2023-10-21 08:05:26 +00:00
|
|
|
return !messageInteractionGraph.chart.empty() || views;
|
2023-10-09 14:10:43 +00:00
|
|
|
}
|
|
|
|
Data::StatisticalGraph messageInteractionGraph;
|
|
|
|
int publicForwards = 0;
|
|
|
|
int privateForwards = 0;
|
|
|
|
int views = 0;
|
|
|
|
};
|
|
|
|
|
2023-10-10 23:40:10 +00:00
|
|
|
struct AnyStatistics final {
|
|
|
|
Data::ChannelStatistics channel;
|
|
|
|
Data::SupergroupStatistics supergroup;
|
|
|
|
Data::MessageStatistics message;
|
|
|
|
};
|
|
|
|
|
2023-10-11 02:10:09 +00:00
|
|
|
struct PublicForwardsSlice final {
|
|
|
|
struct OffsetToken final {
|
|
|
|
int rate = 0;
|
|
|
|
FullMsgId fullId;
|
|
|
|
};
|
|
|
|
QVector<FullMsgId> list;
|
|
|
|
int total = 0;
|
|
|
|
bool allLoaded = false;
|
|
|
|
OffsetToken token;
|
|
|
|
};
|
|
|
|
|
2023-04-26 20:26:30 +00:00
|
|
|
} // namespace Data
|