Improve parameter name.
This commit is contained in:
parent
e8d1c7deae
commit
f8783063f3
@ -8085,7 +8085,7 @@ bool MessagesManager::process_channel_update(tl_object_ptr<telegram_api::Update>
|
||||
}
|
||||
}
|
||||
|
||||
delete_dialog_messages(DialogId(channel_id), message_ids, false, "updateDeleteChannelMessages");
|
||||
delete_dialog_messages(DialogId(channel_id), message_ids, true, "updateDeleteChannelMessages");
|
||||
break;
|
||||
}
|
||||
case telegram_api::updateEditChannelMessage::ID: {
|
||||
@ -9773,7 +9773,7 @@ void MessagesManager::on_restore_missing_message_after_get_difference(FullMessag
|
||||
|
||||
void MessagesManager::on_get_empty_messages(DialogId dialog_id, const vector<MessageId> &empty_message_ids) {
|
||||
if (!empty_message_ids.empty()) {
|
||||
delete_dialog_messages(dialog_id, empty_message_ids, true, "on_get_empty_messages");
|
||||
delete_dialog_messages(dialog_id, empty_message_ids, false, "on_get_empty_messages");
|
||||
}
|
||||
}
|
||||
|
||||
@ -10787,7 +10787,7 @@ void MessagesManager::delete_messages_from_updates(const vector<MessageId> &mess
|
||||
}
|
||||
|
||||
void MessagesManager::delete_dialog_messages(DialogId dialog_id, const vector<MessageId> &message_ids,
|
||||
bool skip_update_for_not_found_messages, const char *source) {
|
||||
bool force_update_for_not_found_messages, const char *source) {
|
||||
Dialog *d = get_dialog_force(dialog_id, "delete_dialog_messages");
|
||||
if (d == nullptr) {
|
||||
LOG(INFO) << "Ignore deleteChannelMessages for unknown " << dialog_id << " from " << source;
|
||||
@ -10795,11 +10795,12 @@ void MessagesManager::delete_dialog_messages(DialogId dialog_id, const vector<Me
|
||||
return;
|
||||
}
|
||||
|
||||
delete_dialog_messages(d, message_ids, skip_update_for_not_found_messages, source);
|
||||
delete_dialog_messages(d, message_ids, force_update_for_not_found_messages, source);
|
||||
}
|
||||
|
||||
void MessagesManager::delete_dialog_messages(Dialog *d, const vector<MessageId> &message_ids,
|
||||
bool skip_update_for_not_found_messages, const char *source) {
|
||||
bool force_update_for_not_found_messages, const char *source) {
|
||||
vector<unique_ptr<Message>> deleted_messages;
|
||||
vector<int64> deleted_message_ids;
|
||||
bool need_update_dialog_pos = false;
|
||||
for (auto message_id : message_ids) {
|
||||
@ -10809,13 +10810,17 @@ void MessagesManager::delete_dialog_messages(Dialog *d, const vector<MessageId>
|
||||
bool was_already_deleted = is_deleted_message(d, message_id);
|
||||
auto message = delete_message(d, message_id, true, &need_update_dialog_pos, source);
|
||||
if (message == nullptr) {
|
||||
if (!skip_update_for_not_found_messages && !was_already_deleted) {
|
||||
if (force_update_for_not_found_messages && !was_already_deleted) {
|
||||
deleted_message_ids.push_back(message_id.get());
|
||||
}
|
||||
} else {
|
||||
deleted_message_ids.push_back(message->message_id.get());
|
||||
deleted_messages.push_back(std::move(message));
|
||||
}
|
||||
}
|
||||
if (deleted_messages.size() >= MIN_DELETED_ASYNCHRONOUSLY_MESSAGES) {
|
||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), deleted_messages);
|
||||
}
|
||||
if (need_update_dialog_pos) {
|
||||
send_update_chat_last_message(d, source);
|
||||
}
|
||||
@ -13434,7 +13439,7 @@ void MessagesManager::ttl_loop(double now) {
|
||||
}
|
||||
}
|
||||
for (auto &it : to_delete) {
|
||||
delete_dialog_messages(it.first, it.second, true, "ttl_loop");
|
||||
delete_dialog_messages(it.first, it.second, false, "ttl_loop");
|
||||
}
|
||||
ttl_update_timeout(now);
|
||||
}
|
||||
@ -14245,7 +14250,7 @@ void MessagesManager::finish_delete_secret_messages(DialogId dialog_id, std::vec
|
||||
LOG(INFO) << "Skip deletion of service " << message_id;
|
||||
}
|
||||
}
|
||||
delete_dialog_messages(d, to_delete_message_ids, false, "finish_delete_secret_messages");
|
||||
delete_dialog_messages(d, to_delete_message_ids, true, "finish_delete_secret_messages");
|
||||
}
|
||||
|
||||
void MessagesManager::delete_secret_chat_history(SecretChatId secret_chat_id, bool remove_from_dialog_list,
|
||||
|
@ -1983,9 +1983,9 @@ class MessagesManager final : public Actor {
|
||||
void delete_messages_from_updates(const vector<MessageId> &message_ids);
|
||||
|
||||
void delete_dialog_messages(DialogId dialog_id, const vector<MessageId> &message_ids,
|
||||
bool skip_update_for_not_found_messages, const char *source);
|
||||
bool force_update_for_not_found_messages, const char *source);
|
||||
|
||||
void delete_dialog_messages(Dialog *d, const vector<MessageId> &message_ids, bool skip_update_for_not_found_messages,
|
||||
void delete_dialog_messages(Dialog *d, const vector<MessageId> &message_ids, bool force_update_for_not_found_messages,
|
||||
const char *source);
|
||||
|
||||
void update_dialog_pinned_messages_from_updates(DialogId dialog_id, const vector<MessageId> &message_ids,
|
||||
|
Loading…
Reference in New Issue
Block a user