2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Added initial api support of reactions limit in channels and groups.

This commit is contained in:
23rd
2024-04-12 14:22:57 +03:00
committed by John Preston
parent 5543927042
commit 225c0e0af3
5 changed files with 50 additions and 12 deletions

View File

@@ -471,10 +471,13 @@ void ApplyChatUpdate(not_null<ChatData*> chat, const MTPDchatFull &update) {
chat->checkFolder(update.vfolder_id().value_or_empty());
chat->setThemeEmoji(qs(update.vtheme_emoticon().value_or_empty()));
chat->setTranslationDisabled(update.is_translations_disabled());
const auto reactionsLimit = update.vreactions_limit().value_or_empty();
if (const auto allowed = update.vavailable_reactions()) {
chat->setAllowedReactions(Data::Parse(*allowed));
auto parsed = Data::Parse(*allowed);
parsed.maxCount = reactionsLimit;
chat->setAllowedReactions(std::move(parsed));
} else {
chat->setAllowedReactions({});
chat->setAllowedReactions({ .maxCount = reactionsLimit });
}
chat->fullUpdated();
chat->setAbout(qs(update.vabout()));