mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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()
|
if (!item->isService()
|
||||||
&& peerIsChannel(itemId.peer)
|
&& peerIsChannel(itemId.peer)
|
||||||
&& !_peer->isMegagroup()) {
|
&& !_peer->isMegagroup()) {
|
||||||
|
constexpr auto kMinViewsCount = 10;
|
||||||
if (const auto channel = _peer->asChannel()) {
|
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, [=] {
|
auto callback = crl::guard(controller, [=] {
|
||||||
controller->showSection(
|
controller->showSection(
|
||||||
Info::Statistics::Make(channel, itemId, {}));
|
Info::Statistics::Make(channel, itemId, {}));
|
||||||
|
|
Loading…
Add table
Reference in a new issue