2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Handle clicks on topic jump area.

This commit is contained in:
John Preston
2022-11-14 11:24:31 +04:00
parent ede34578da
commit 561e3f4809
11 changed files with 486 additions and 141 deletions

View File

@@ -415,8 +415,19 @@ void Widget::chosenRow(const ChosenRow &row) {
const auto openSearchResult = !controller()->selectingPeer()
&& row.filteredRow;
const auto history = row.key.history();
if (const auto topic = row.key.topic()) {
controller()->content()->chooseThread(topic, row.message.fullId.msg);
const auto topicJump = history
? history->peer->forumTopicFor(row.message.fullId.msg)
: nullptr;
if (topicJump) {
controller()->openForum(history->peer->asChannel());
controller()->content()->chooseThread(
topicJump,
ShowAtUnreadMsgId);
return;
} else if (const auto topic = row.key.topic()) {
controller()->content()->chooseThread(
topic,
row.message.fullId.msg);
} else if (history && history->peer->isForum() && !row.message.fullId) {
controller()->openForum(history->peer->asChannel());
return;