Remove chosen reaction when it is again.
This commit is contained in:
parent
893b9c4b6f
commit
9eb3a9a403
@ -4601,7 +4601,7 @@ editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:Messa
|
|||||||
//@description Changes chosen reaction for a message
|
//@description Changes chosen reaction for a message
|
||||||
//@chat_id Identifier of the chat to which the message belongs
|
//@chat_id Identifier of the chat to which the message belongs
|
||||||
//@message_id Identifier of the message
|
//@message_id Identifier of the message
|
||||||
//@reaction Text representation of the chosen reaction, or an empty string to remove reaction
|
//@reaction Text representation of the chosen reaction. Can be an empty string or the currently chosen reaction to remove the reaction
|
||||||
setMessageReaction chat_id:int53 message_id:int53 reaction:string = Ok;
|
setMessageReaction chat_id:int53 message_id:int53 reaction:string = Ok;
|
||||||
|
|
||||||
//@description Returns reactions chosen for a message, along with their source
|
//@description Returns reactions chosen for a message, along with their source
|
||||||
|
@ -23755,7 +23755,8 @@ void MessagesManager::set_message_reaction(FullMessageId full_message_id, string
|
|||||||
auto &message_reaction = *it;
|
auto &message_reaction = *it;
|
||||||
if (message_reaction.is_chosen()) {
|
if (message_reaction.is_chosen()) {
|
||||||
if (message_reaction.get_reaction() == reaction) {
|
if (message_reaction.get_reaction() == reaction) {
|
||||||
return promise.set_value(Unit());
|
// double set removes reaction
|
||||||
|
reaction = string();
|
||||||
}
|
}
|
||||||
message_reaction.set_is_chosen(false);
|
message_reaction.set_is_chosen(false);
|
||||||
if (message_reaction.is_empty()) {
|
if (message_reaction.is_empty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user