mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Support channel stories archive.
This commit is contained in:
@@ -66,6 +66,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "info/info_memento.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "info/profile/info_profile_values.h"
|
||||
#include "info/stories/info_stories_widget.h"
|
||||
#include "data/notify/data_notify_settings.h"
|
||||
#include "data/data_changes.h"
|
||||
#include "data/data_session.h"
|
||||
@@ -249,6 +250,7 @@ private:
|
||||
void addToggleMuteSubmenu(bool addSeparator);
|
||||
void addSupportInfo();
|
||||
void addInfo();
|
||||
void addStoryArchive();
|
||||
void addNewWindow();
|
||||
void addToggleFolder();
|
||||
void addToggleUnreadMark();
|
||||
@@ -548,6 +550,22 @@ void Filler::addInfo() {
|
||||
}, _peer->isUser() ? &st::menuIconProfile : &st::menuIconInfo);
|
||||
}
|
||||
|
||||
void Filler::addStoryArchive() {
|
||||
const auto channel = _peer ? _peer->asChannel() : nullptr;
|
||||
if (!channel || !channel->canEditStories()) {
|
||||
return;
|
||||
}
|
||||
const auto controller = _controller;
|
||||
const auto weak = base::make_weak(_thread);
|
||||
_addAction(tr::lng_stories_archive_button(tr::now), [=] {
|
||||
if (const auto strong = weak.get()) {
|
||||
controller->showSection(Info::Stories::Make(
|
||||
channel,
|
||||
Info::Stories::Tab::Archive));
|
||||
}
|
||||
}, &st::menuIconStoriesArchiveSection);
|
||||
}
|
||||
|
||||
void Filler::addToggleFolder() {
|
||||
const auto controller = _controller;
|
||||
const auto history = _request.key.history();
|
||||
@@ -1196,6 +1214,7 @@ void Filler::fillContextMenuActions() {
|
||||
void Filler::fillHistoryActions() {
|
||||
addToggleMuteSubmenu(true);
|
||||
addInfo();
|
||||
addStoryArchive();
|
||||
addSupportInfo();
|
||||
addManageChat();
|
||||
addCreatePoll();
|
||||
|
Reference in New Issue
Block a user