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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user