Extended conditions to ability to view channel message statistics.

This commit is contained in:
23rd 2024-07-18 01:54:05 +03:00
parent a52d4eb4e8
commit 2a63496054

View file

@ -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, {}));