mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Added ability to open boosts info without statistics info access.
This commit is contained in:
parent
1af4af6ff3
commit
df3ae2c5f8
1 changed files with 11 additions and 10 deletions
|
@ -1001,22 +1001,23 @@ void Filler::addManageChat() {
|
|||
|
||||
void Filler::addViewStatistics() {
|
||||
if (const auto channel = _peer->asChannel()) {
|
||||
const auto controller = _controller;
|
||||
const auto weak = base::make_weak(_thread);
|
||||
const auto peer = _peer;
|
||||
if (channel->flags() & ChannelDataFlag::CanGetStatistics) {
|
||||
const auto controller = _controller;
|
||||
const auto weak = base::make_weak(_thread);
|
||||
const auto peer = _peer;
|
||||
_addAction(tr::lng_stats_title(tr::now), [=] {
|
||||
if (const auto strong = weak.get()) {
|
||||
controller->showSection(Info::Statistics::Make(peer, {}));
|
||||
}
|
||||
}, &st::menuIconStats);
|
||||
if (!channel->isMegagroup()) {
|
||||
_addAction(tr::lng_boosts_title(tr::now), [=] {
|
||||
if (const auto strong = weak.get()) {
|
||||
controller->showSection(Info::Boosts::Make(peer));
|
||||
}
|
||||
}, &st::menuIconBoosts);
|
||||
}
|
||||
}
|
||||
if (!channel->isMegagroup()
|
||||
&& (channel->amCreator() || channel->canPostStories())) {
|
||||
_addAction(tr::lng_boosts_title(tr::now), [=] {
|
||||
if (const auto strong = weak.get()) {
|
||||
controller->showSection(Info::Boosts::Make(peer));
|
||||
}
|
||||
}, &st::menuIconBoosts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue