Improved processing of access to boosts info.

This commit is contained in:
23rd 2023-11-30 22:03:30 +03:00 committed by John Preston
parent 88b20f6700
commit cccc2ce0f1

View file

@ -1005,7 +1005,9 @@ void Filler::addViewStatistics() {
const auto controller = _controller;
const auto weak = base::make_weak(_thread);
const auto peer = _peer;
if (channel->flags() & ChannelDataFlag::CanGetStatistics) {
using Flag = ChannelDataFlag;
const auto canGetStats = (channel->flags() & Flag::CanGetStatistics);
if (canGetStats) {
_addAction(tr::lng_stats_title(tr::now), [=] {
if (const auto strong = weak.get()) {
using namespace Info;
@ -1014,7 +1016,9 @@ void Filler::addViewStatistics() {
}, &st::menuIconStats);
}
if (!channel->isMegagroup()
&& (channel->amCreator() || channel->canPostStories())) {
&& (canGetStats
|| channel->amCreator()
|| channel->canPostStories())) {
_addAction(tr::lng_boosts_title(tr::now), [=] {
if (const auto strong = weak.get()) {
controller->showSection(Info::Boosts::Make(peer));