2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Support cloud view_as_messages forum setting.

This commit is contained in:
John Preston
2023-11-16 20:53:06 +04:00
parent 43a8733fc7
commit 0ffda016da
10 changed files with 102 additions and 9 deletions

View File

@@ -281,6 +281,7 @@ private:
void addGiftPremium();
void addCreateTopic();
void addViewAsMessages();
void addViewAsTopics();
void addSearchTopics();
void addDeleteTopic();
void addVideoChat();
@@ -1147,10 +1148,29 @@ void Filler::addViewAsMessages() {
const auto peer = _peer;
const auto controller = _controller;
_addAction(tr::lng_forum_view_as_messages(tr::now), [=] {
if (const auto forum = peer->forum()) {
peer->owner().saveViewAsMessages(forum, true);
}
controller->showPeerHistory(peer->id);
}, &st::menuIconViewReplies);
}
void Filler::addViewAsTopics() {
if (!_peer
|| !_peer->isForum()
|| !_controller->adaptive().isOneColumn()) {
return;
}
const auto peer = _peer;
const auto controller = _controller;
_addAction(tr::lng_forum_view_as_topics(tr::now), [=] {
if (const auto forum = peer->forum()) {
peer->owner().saveViewAsMessages(forum, false);
controller->showForum(forum);
}
}, &st::menuIconViewReplies);
}
void Filler::addSearchTopics() {
const auto forum = _peer ? _peer->forum() : nullptr;
if (!forum) {
@@ -1235,6 +1255,7 @@ void Filler::fillContextMenuActions() {
void Filler::fillHistoryActions() {
addToggleMuteSubmenu(true);
addInfo();
addViewAsTopics();
addStoryArchive();
addSupportInfo();
addManageChat();