mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Make giveaway end message clickable.
This commit is contained in:
parent
e135f8954f
commit
8abc35ca86
3 changed files with 11 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -599,6 +599,11 @@ struct HistoryServiceSameBackground
|
|||
, public HistoryServiceDependentData {
|
||||
};
|
||||
|
||||
struct HistoryServiceGiveawayResults
|
||||
: public RuntimeComponent<HistoryServiceGiveawayResults, HistoryItem>
|
||||
, public HistoryServiceDependentData {
|
||||
};
|
||||
|
||||
enum class HistorySelfDestructType {
|
||||
Photo,
|
||||
Video,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue