Allow arbitrary reaction order in setChatAvailableReactions.
This commit is contained in:
parent
987e875520
commit
3d8e5e00e4
@ -4899,7 +4899,7 @@ toggleChatIsMarkedAsUnread chat_id:int53 is_marked_as_unread:Bool = Ok;
|
||||
//@description Changes the value of the default disable_notification parameter, used when a message is sent to a chat @chat_id Chat identifier @default_disable_notification New value of default_disable_notification
|
||||
toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:Bool = Ok;
|
||||
|
||||
//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions New list of reactions, available in the chat. All reactions must be active and order of the reactions must be the same as in updateReactions
|
||||
//@description Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @available_reactions New list of reactions, available in the chat. All reactions must be active
|
||||
setChatAvailableReactions chat_id:int53 available_reactions:vector<string> = Ok;
|
||||
|
||||
//@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data
|
||||
|
@ -33063,9 +33063,11 @@ void MessagesManager::set_dialog_available_reactions(DialogId dialog_id, vector<
|
||||
return promise.set_error(Status::Error(400, "Chat not found"));
|
||||
}
|
||||
|
||||
if (get_active_reactions(available_reactions) != available_reactions) {
|
||||
auto active_reactions = get_active_reactions(available_reactions);
|
||||
if (active_reactions.size() != available_reactions.size()) {
|
||||
return promise.set_error(Status::Error(400, "Invalid reactions specified"));
|
||||
}
|
||||
available_reactions = std::move(active_reactions);
|
||||
|
||||
switch (dialog_id.get_type()) {
|
||||
case DialogType::User:
|
||||
|
Loading…
x
Reference in New Issue
Block a user