Always open first topic in two-column layout.

This commit is contained in:
John Preston 2022-11-21 16:42:52 +00:00
parent f97e5d6307
commit 106bdae9ce
1 changed files with 18 additions and 7 deletions

View File

@ -3212,13 +3212,24 @@ bool InnerWidget::chooseRow(
if (IsServerMsgId(chosen.message.fullId.msg)) {
session().local().saveRecentSearchHashtags(_filter);
}
if (pressedTopicRootId && !chosen.message.fullId) {
const auto history = chosen.key.history();
if (history->peer->isForum()) {
chosen.message.fullId = {
history->peer->id,
pressedTopicRootId,
};
if (!chosen.message.fullId) {
if (const auto history = chosen.key.history()) {
if (const auto forum = history->peer->forum()) {
if (pressedTopicRootId) {
chosen.message.fullId = {
history->peer->id,
pressedTopicRootId,
};
} else if (!_controller->adaptive().isOneColumn()) {
const auto &recent = forum->recentTopics();
if (!recent.empty()) {
chosen.message.fullId = {
history->peer->id,
recent.front()->rootId(),
};
}
}
}
}
}
_chosenRow.fire_copy(chosen);