mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Added initial entry point to statistics info for stories.
This commit is contained in:
parent
2bb8850e69
commit
7d2d0bdfa2
2 changed files with 17 additions and 0 deletions
|
@ -40,6 +40,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/boxes/confirm_box.h"
|
||||
#include "info/info_memento.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "info/statistics/info_statistics_widget.h"
|
||||
#include "boxes/delete_messages_box.h"
|
||||
#include "boxes/report_messages_box.h"
|
||||
#include "media/audio/media_audio.h"
|
||||
|
@ -1679,6 +1680,21 @@ void OverlayWidget::fillContextMenuActions(const MenuCallback &addAction) {
|
|||
}
|
||||
}, &st::mediaMenuIconReport);
|
||||
}();
|
||||
{
|
||||
const auto channel = story ? story->peer()->asChannel() : nullptr;
|
||||
using Flag = ChannelDataFlag;
|
||||
if (channel && (channel->flags() & Flag::CanGetStatistics)) {
|
||||
const auto peer = channel;
|
||||
const auto fullId = story->fullId();
|
||||
addAction(tr::lng_stats_title(tr::now), [=] {
|
||||
if (const auto window = findWindow()) {
|
||||
close();
|
||||
using namespace Info;
|
||||
window->showSection(Statistics::Make(peer, {}, fullId));
|
||||
}
|
||||
}, &st::mediaMenuIconStats);
|
||||
}
|
||||
}
|
||||
if (_stories && _stories->allowStealthMode()) {
|
||||
const auto now = base::unixtime::now();
|
||||
const auto stealth = _session->data().stories().stealthMode();
|
||||
|
|
|
@ -174,6 +174,7 @@ mediaMenuIconSaveStory: icon {{ "menu/stories_save", mediaviewMenuFg }};
|
|||
mediaMenuIconArchiveStory: icon {{ "menu/stories_archive", mediaviewMenuFg }};
|
||||
mediaMenuIconStealthLocked: icon {{ "menu/stealth_locked", mediaviewMenuFg }};
|
||||
mediaMenuIconStealth: icon {{ "menu/stealth", mediaviewMenuFg }};
|
||||
mediaMenuIconStats: icon {{ "menu/stats", mediaviewMenuFg }};
|
||||
|
||||
menuIconDeleteAttention: icon {{ "menu/delete", menuIconAttentionColor }};
|
||||
menuIconLeaveAttention: icon {{ "menu/leave", menuIconAttentionColor }};
|
||||
|
|
Loading…
Add table
Reference in a new issue