Support sponsored peers in search results.

This commit is contained in:
John Preston
2025-03-20 17:06:02 +04:00
parent 33c5b35444
commit a0764190f2
17 changed files with 546 additions and 227 deletions
@@ -835,7 +835,10 @@ void Widget::setupSwipeBack() {
void Widget::chosenRow(const ChosenRow &row) {
storiesToggleExplicitExpand(false);
if (!_searchState.query.isEmpty()) {
if (!row.sponsoredRandomId.isEmpty()) {
auto &messages = session().sponsoredMessages();
messages.clicked(row.sponsoredRandomId, false, false);
} else if (!_searchState.query.isEmpty()) {
if (const auto history = row.key.history()) {
session().recentPeers().bump(history->peer);
}
@@ -846,11 +849,6 @@ void Widget::chosenRow(const ChosenRow &row) {
? history->peer->forumTopicFor(row.message.fullId.msg)
: nullptr;
if (!row.sponsoredRandomId.isEmpty()) {
auto &messages = session().sponsoredMessages();
messages.clicked(row.sponsoredRandomId, false, false);
}
if (topicJump) {
if (controller()->shownForum().current() == topicJump->forum()) {
controller()->closeForum();