mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Extended conditions to ability to view channel message statistics.
This commit is contained in:
parent
a52d4eb4e8
commit
2a63496054
1 changed files with 4 additions and 1 deletions
|
@ -2227,8 +2227,11 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
|||
if (!item->isService()
|
||||
&& peerIsChannel(itemId.peer)
|
||||
&& !_peer->isMegagroup()) {
|
||||
constexpr auto kMinViewsCount = 10;
|
||||
if (const auto channel = _peer->asChannel()) {
|
||||
if (channel->flags() & ChannelDataFlag::CanGetStatistics) {
|
||||
if ((channel->flags() & ChannelDataFlag::CanGetStatistics)
|
||||
|| (channel->canPostMessages()
|
||||
&& item->viewsCount() >= kMinViewsCount)) {
|
||||
auto callback = crl::guard(controller, [=] {
|
||||
controller->showSection(
|
||||
Info::Statistics::Make(channel, itemId, {}));
|
||||
|
|
Loading…
Add table
Reference in a new issue