2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-04 08:25:38 +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

@@ -520,18 +520,37 @@ void Widget::chosenRow(const ChosenRow &row) {
}
return;
} else if (const auto topic = row.key.topic()) {
session().data().saveViewAsMessages(topic->forum(), false);
controller()->showThread(
topic,
row.message.fullId.msg,
Window::SectionShow::Way::ClearStack);
} else if (history && history->isForum() && !row.message.fullId) {
} else if (history
&& history->isForum()
&& !row.message.fullId
&& (!controller()->adaptive().isOneColumn()
|| !history->peer->forum()->channel()->viewForumAsMessages())) {
const auto forum = history->peer->forum();
if (controller()->shownForum().current() == forum) {
controller()->closeForum();
} else {
controller()->showForum(
forum,
Window::SectionShow().withChildColumn());
return;
}
controller()->showForum(
forum,
Window::SectionShow().withChildColumn());
if (forum->channel()->viewForumAsMessages()) {
controller()->showThread(
history,
ShowAtUnreadMsgId,
Window::SectionShow::Way::ClearStack);
} else if (!controller()->adaptive().isOneColumn()) {
const auto item = history->chatListMessage();
if (const auto topic = item ? item->topic() : nullptr) {
controller()->showThread(
topic,
ShowAtUnreadMsgId,
Window::SectionShow::Way::ClearStack);
}
}
return;
} else if (history) {