mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add "View as Messages" in forums.
This commit is contained in:
parent
9ddbc75638
commit
fcc4503791
2 changed files with 15 additions and 0 deletions
|
@ -3511,6 +3511,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_forum_no_topics" = "No topics currently created in this forum.";
|
"lng_forum_no_topics" = "No topics currently created in this forum.";
|
||||||
"lng_forum_create_topic" = "Create topic";
|
"lng_forum_create_topic" = "Create topic";
|
||||||
"lng_forum_discard_sure" = "Discard sure?";
|
"lng_forum_discard_sure" = "Discard sure?";
|
||||||
|
"lng_forum_view_as_messages" = "View as Messages";
|
||||||
|
|
||||||
// Wnd specific
|
// Wnd specific
|
||||||
|
|
||||||
|
|
|
@ -237,6 +237,7 @@ private:
|
||||||
void addTTLSubmenu(bool addSeparator);
|
void addTTLSubmenu(bool addSeparator);
|
||||||
void addGiftPremium();
|
void addGiftPremium();
|
||||||
void addCreateTopic();
|
void addCreateTopic();
|
||||||
|
void addViewAsMessages();
|
||||||
void addSearchTopics();
|
void addSearchTopics();
|
||||||
|
|
||||||
not_null<SessionController*> _controller;
|
not_null<SessionController*> _controller;
|
||||||
|
@ -948,6 +949,18 @@ void Filler::addCreateTopic() {
|
||||||
_addAction(PeerMenuCallback::Args{ .isSeparator = true });
|
_addAction(PeerMenuCallback::Args{ .isSeparator = true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Filler::addViewAsMessages() {
|
||||||
|
if (!_peer || !_peer->isForum()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto peer = _peer;
|
||||||
|
const auto controller = _controller;
|
||||||
|
_addAction(tr::lng_forum_view_as_messages(tr::now), [=] {
|
||||||
|
controller->showPeerHistory(peer->id);
|
||||||
|
}, &st::menuIconViewReplies);
|
||||||
|
_addAction(PeerMenuCallback::Args{ .isSeparator = true });
|
||||||
|
}
|
||||||
|
|
||||||
void Filler::addSearchTopics() {
|
void Filler::addSearchTopics() {
|
||||||
_addAction(tr::lng_dlg_filter(tr::now), [=] {
|
_addAction(tr::lng_dlg_filter(tr::now), [=] {
|
||||||
|
|
||||||
|
@ -959,6 +972,7 @@ void Filler::fillChatsListActions() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
addCreateTopic();
|
addCreateTopic();
|
||||||
|
addViewAsMessages();
|
||||||
addInfo();
|
addInfo();
|
||||||
addNewMembers();
|
addNewMembers();
|
||||||
const auto &all = _peer->forum()->topicsList()->indexed()->all();
|
const auto &all = _peer->forum()->topicsList()->indexed()->all();
|
||||||
|
|
Loading…
Add table
Reference in a new issue