Fix fixing of is_dialog_pinned_message_notifications_disabled.

GitOrigin-RevId: 28993e5eead5c487b0e3c1efe1d69ba936561e1a
This commit is contained in:
levlam 2019-04-19 01:03:33 +03:00
parent 112c7c0168
commit 849a4fbdb1
3 changed files with 8 additions and 5 deletions

View File

@ -177,7 +177,7 @@ void FileReferenceManager::run_node(NodeId node_id) {
VLOG(file_references) << "Have no more file sources to repair file reference for file " << node_id;
for (auto &p : node.query->promises) {
if (node.file_source_ids.empty()) {
p.set_error(Status::Error(400, "File not found"));
p.set_error(Status::Error(400, "File source is not found"));
} else {
p.set_error(Status::Error(429, "Too Many Requests: retry after 1"));
}

View File

@ -23872,18 +23872,21 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr<Message> &&last_datab
update_dialog_unmute_timeout(d, false, -1, false, d->notification_settings.mute_until);
}
if (d->pinned_message_notification_message_id.is_valid()) {
auto &pinned_message_id = d->pinned_message_notification_message_id;
auto pinned_message_id = d->pinned_message_notification_message_id;
if (!d->mention_notification_group.group_id.is_valid()) {
LOG(ERROR) << "Have pinned message notification in " << pinned_message_id << " in " << dialog_id
<< ", but there is no mention notification group";
pinned_message_id = MessageId();
d->pinned_message_notification_message_id = MessageId();
on_dialog_updated(d->dialog_id, "fix pinned message notification");
} else if (is_dialog_pinned_message_notifications_disabled(d) ||
pinned_message_id.get() <= d->last_read_inbox_message_id.get() ||
pinned_message_id.get() <= d->mention_notification_group.max_removed_message_id.get()) {
VLOG(notifications) << "Remove disabled pinned message notification in " << pinned_message_id << " in "
<< dialog_id;
remove_dialog_pinned_message_notification(d);
send_closure_later(G()->notification_manager(), &NotificationManager::remove_temporary_notification_by_message_id,
d->mention_notification_group.group_id, pinned_message_id, false);
d->pinned_message_notification_message_id = MessageId();
on_dialog_updated(d->dialog_id, "fix pinned message notification 2");
}
}
if (d->new_secret_chat_notification_id.is_valid()) {

View File

@ -276,7 +276,7 @@ Status FileDownloader::check_net_query(NetQueryPtr &net_query) {
if (net_query->is_error()) {
auto error = net_query->move_as_error();
if (FileReferenceManager::is_file_reference_error(error)) {
VLOG(file_references) << "Receive " << error << " for downloaded file";
VLOG(file_references) << "Receive " << error << " for being downloaded file";
error = Status::Error(error.code(), PSLICE() << error.message() << "#BASE64"
<< base64_encode(remote_.get_download_file_reference()));
}