2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added entry point for channel earn info section.

This commit is contained in:
23rd
2024-03-27 21:32:42 +03:00
committed by John Preston
parent c66b5b2490
commit 9b0f3bedff
5 changed files with 10 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_controller.h"
#include "info/info_memento.h"
#include "info/channel_statistics/boosts/info_boosts_widget.h"
#include "info/channel_statistics/earn/info_earn_widget.h"
#include "info/profile/info_profile_values.h"
#include "info/statistics/info_statistics_widget.h"
#include "info/stories/info_stories_widget.h"
@@ -1039,6 +1040,7 @@ void Filler::addViewStatistics() {
const auto peer = _peer;
using Flag = ChannelDataFlag;
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
const auto canViewEarn = (channel->flags() & Flag::CanViewRevenue);
if (canGetStats) {
_addAction(tr::lng_stats_title(tr::now), [=] {
if (const auto strong = weak.get()) {
@@ -1062,6 +1064,13 @@ void Filler::addViewStatistics() {
}
}, &st::menuIconBoosts);
}
if (canViewEarn) {
_addAction(tr::lng_channel_earn_title(tr::now), [=] {
if (const auto strong = weak.get()) {
controller->showSection(Info::ChannelEarn::Make(peer));
}
}, &st::menuIconEarn);
}
}
}