Make giveaway end message clickable.

This commit is contained in:
John Preston 2023-12-08 11:35:40 +04:00
parent e135f8954f
commit 8abc35ca86
3 changed files with 11 additions and 0 deletions

View file

@ -788,6 +788,8 @@ HistoryServiceDependentData *HistoryItem::GetServiceDependentData() {
return info;
} else if (const auto same = Get<HistoryServiceSameBackground>()) {
return same;
} else if (const auto results = Get<HistoryServiceGiveawayResults>()) {
return results;
}
return nullptr;
}
@ -3705,6 +3707,8 @@ void HistoryItem::createServiceFromMtp(const MTPDmessageService &message) {
} else {
RemoveComponents(HistoryServiceSameBackground::Bit());
}
} else if (type == mtpc_messageActionGiveawayResults) {
UpdateComponents(HistoryServiceGiveawayResults::Bit());
}
if (const auto replyTo = message.vreply_to()) {
replyTo->match([&](const MTPDmessageReplyHeader &data) {

View file

@ -599,6 +599,11 @@ struct HistoryServiceSameBackground
, public HistoryServiceDependentData {
};
struct HistoryServiceGiveawayResults
: public RuntimeComponent<HistoryServiceGiveawayResults, HistoryItem>
, public HistoryServiceDependentData {
};
enum class HistorySelfDestructType {
Photo,
Video,

View file

@ -673,6 +673,8 @@ TextState Service::textState(QPoint point, StateRequest request) const {
}
} else if (const auto same = item->Get<HistoryServiceSameBackground>()) {
result.link = same->lnk;
} else if (const auto results = item->Get<HistoryServiceGiveawayResults>()) {
result.link = results->lnk;
} else if (media && data()->showSimilarChannels()) {
result = media->textState(mediaPoint, request);
}