2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

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

View File

@@ -106,9 +106,10 @@ void PeerSearch::requestSponsored() {
parsed.sponsored.push_back({
.peer = _session->data().peer(peerId),
.randomId = data.vrandom_id().v,
.sponsorInfo = qs(data.vsponsor_info().value_or_empty()),
.additionalInfo = qs(
data.vadditional_info().value_or_empty()),
.sponsorInfo = TextWithEntities::Simple(
qs(data.vsponsor_info().value_or_empty())),
.additionalInfo = TextWithEntities::Simple(
qs(data.vadditional_info().value_or_empty())),
});
}
finishSponsored(requestId, std::move(parsed));

View File

@@ -16,8 +16,8 @@ namespace Api {
struct SponsoredSearchResult {
not_null<PeerData*> peer;
QByteArray randomId;
QString sponsorInfo;
QString additionalInfo;
TextWithEntities sponsorInfo;
TextWithEntities additionalInfo;
};
struct PeerSearchResult {