Add availableReactions.allow_custom_emoji.

This commit is contained in:
levlam 2022-09-09 16:28:51 +03:00
parent 55ec944266
commit a223067cd1
3 changed files with 7 additions and 3 deletions

View File

@ -2580,8 +2580,8 @@ addedReaction type:ReactionType sender_id:MessageSender = AddedReaction;
//@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results
addedReactions total_count:int32 reactions:vector<addedReaction> next_offset:string = AddedReactions;
//@description Represents a list of available reactions @reactions List of available reactions
availableReactions reactions:vector<ReactionType> = AvailableReactions;
//@description Represents a list of reactions that can be added to a message @reactions List of available reactions @allow_custom_emoji True, if any other custom emoji reaction can be added
availableReactions reactions:vector<ReactionType> allow_custom_emoji:Bool = AvailableReactions;
//@description Contains stickers which must be used for emoji reaction animation rendering

View File

@ -80,7 +80,8 @@ td_api::object_ptr<td_api::ChatAvailableReactions> ChatReactions::get_chat_avail
td_api::object_ptr<td_api::availableReactions> ChatReactions::get_available_reactions_object() const {
CHECK(!allow_all_);
return td_api::make_object<td_api::availableReactions>(transform(reactions_, get_reaction_type_object));
return td_api::make_object<td_api::availableReactions>(transform(reactions_, get_reaction_type_object),
allow_custom_);
}
telegram_api::object_ptr<telegram_api::ChatReactions> ChatReactions::get_input_chat_reactions() const {

View File

@ -24512,6 +24512,9 @@ ChatReactions MessagesManager::get_message_available_reactions(const Dialog *d,
}
}
}
if (!td_->option_manager_->get_option_boolean("is_premium")) {
active_reactions.allow_custom_ = false;
}
return active_reactions;
}