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

Allow enabling paid reactions.

This commit is contained in:
John Preston
2024-08-05 11:53:42 +02:00
parent 126fd89bb7
commit bb3fc17489
33 changed files with 248 additions and 80 deletions

View File

@@ -1220,11 +1220,16 @@ void ApplyChannelUpdate(
const auto reactionsLimit = update.vreactions_limit().value_or_empty();
if (const auto allowed = update.vavailable_reactions()) {
auto parsed = Data::Parse(*allowed);
parsed.maxCount = reactionsLimit;
auto parsed = Data::Parse(
*allowed,
reactionsLimit,
update.is_paid_reactions_available());
channel->setAllowedReactions(std::move(parsed));
} else {
channel->setAllowedReactions({ .maxCount = reactionsLimit });
channel->setAllowedReactions({
.maxCount = reactionsLimit,
.paidEnabled = update.is_paid_reactions_available(),
});
}
channel->owner().stories().apply(channel, update.vstories());
channel->fullUpdated();