Fix my_recent_chooser when removing reaction.
This commit is contained in:
parent
e4a15cc0ef
commit
f733cb56ce
@ -741,7 +741,7 @@ bool MessageReactions::add_reaction(const string &reaction, bool is_big, DialogI
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MessageReactions::remove_reaction(const string &reaction) {
|
bool MessageReactions::remove_reaction(const string &reaction, DialogId my_dialog_id) {
|
||||||
if (do_remove_reaction(reaction)) {
|
if (do_remove_reaction(reaction)) {
|
||||||
if (!chosen_reaction_order_.empty()) {
|
if (!chosen_reaction_order_.empty()) {
|
||||||
bool is_removed = td::remove(chosen_reaction_order_, reaction);
|
bool is_removed = td::remove(chosen_reaction_order_, reaction);
|
||||||
@ -760,6 +760,10 @@ bool MessageReactions::remove_reaction(const string &reaction) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto &message_reaction : reactions_) {
|
||||||
|
message_reaction.set_my_recent_chooser_dialog_id(my_dialog_id);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -175,7 +175,7 @@ struct MessageReactions {
|
|||||||
|
|
||||||
bool add_reaction(const string &reaction, bool is_big, DialogId my_dialog_id, bool have_recent_choosers);
|
bool add_reaction(const string &reaction, bool is_big, DialogId my_dialog_id, bool have_recent_choosers);
|
||||||
|
|
||||||
bool remove_reaction(const string &reaction);
|
bool remove_reaction(const string &reaction, DialogId my_dialog_id);
|
||||||
|
|
||||||
void sort_reactions(const FlatHashMap<string, size_t> &active_reaction_pos);
|
void sort_reactions(const FlatHashMap<string, size_t> &active_reaction_pos);
|
||||||
|
|
||||||
|
@ -23843,7 +23843,9 @@ void MessagesManager::remove_message_reaction(FullMessageId full_message_id, str
|
|||||||
return promise.set_error(Status::Error(400, "Invalid reaction specified"));
|
return promise.set_error(Status::Error(400, "Invalid reaction specified"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->reactions == nullptr || !m->reactions->remove_reaction(reaction)) {
|
auto my_dialog_id =
|
||||||
|
d->default_send_message_as_dialog_id.is_valid() ? d->default_send_message_as_dialog_id : get_my_dialog_id();
|
||||||
|
if (m->reactions == nullptr || !m->reactions->remove_reaction(reaction, my_dialog_id)) {
|
||||||
return promise.set_value(Unit());
|
return promise.set_value(Unit());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user