Send updateAnimatedEmojiMessageClicked only in opened chats.
This commit is contained in:
parent
95d4ec8973
commit
551103a084
@ -17454,6 +17454,11 @@ void MessagesManager::get_messages_from_server(vector<FullMessageId> &&message_i
|
||||
lock.set_value(Unit());
|
||||
}
|
||||
|
||||
bool MessagesManager::is_dialog_opened(DialogId dialog_id) const {
|
||||
const Dialog *d = get_dialog(dialog_id);
|
||||
return d != nullptr && d->is_opened;
|
||||
}
|
||||
|
||||
bool MessagesManager::is_message_edited_recently(FullMessageId full_message_id, int32 seconds) {
|
||||
if (seconds < 0) {
|
||||
return false;
|
||||
|
@ -580,6 +580,8 @@ class MessagesManager final : public Actor {
|
||||
|
||||
void get_message_viewers(FullMessageId full_message_id, Promise<td_api::object_ptr<td_api::users>> &&promise);
|
||||
|
||||
bool is_dialog_opened(DialogId dialog_id) const;
|
||||
|
||||
bool is_message_edited_recently(FullMessageId full_message_id, int32 seconds);
|
||||
|
||||
bool is_deleted_secret_chat(DialogId dialog_id) const;
|
||||
|
@ -4255,7 +4255,11 @@ void StickersManager::schedule_update_animated_emoji_clicked(const StickerSet *s
|
||||
// includes deleted full_message_id
|
||||
return;
|
||||
}
|
||||
if (!td_->messages_manager_->have_input_peer(full_message_id.get_dialog_id(), AccessRights::Write)) {
|
||||
auto dialog_id = full_message_id.get_dialog_id();
|
||||
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Write)) {
|
||||
return;
|
||||
}
|
||||
if (!td_->messages_manager_->is_dialog_opened(dialog_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4301,6 +4305,9 @@ void StickersManager::send_update_animated_emoji_clicked(FullMessageId full_mess
|
||||
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Write)) {
|
||||
return;
|
||||
}
|
||||
if (!td_->messages_manager_->is_dialog_opened(dialog_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
send_closure(G()->td(), &Td::send_update,
|
||||
td_api::make_object<td_api::updateAnimatedEmojiMessageClicked>(
|
||||
|
Loading…
Reference in New Issue
Block a user