From 849a4fbdb18881fdbda80a49858ee31119a5fd80 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 19 Apr 2019 01:03:33 +0300 Subject: [PATCH] Fix fixing of is_dialog_pinned_message_notifications_disabled. GitOrigin-RevId: 28993e5eead5c487b0e3c1efe1d69ba936561e1a --- td/telegram/FileReferenceManager.cpp | 2 +- td/telegram/MessagesManager.cpp | 9 ++++++--- td/telegram/files/FileDownloader.cpp | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/td/telegram/FileReferenceManager.cpp b/td/telegram/FileReferenceManager.cpp index 6f929f07..c3064e83 100644 --- a/td/telegram/FileReferenceManager.cpp +++ b/td/telegram/FileReferenceManager.cpp @@ -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")); } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 42a692a3..b3b43a65 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -23872,18 +23872,21 @@ void MessagesManager::fix_new_dialog(Dialog *d, unique_ptr &&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()) { diff --git a/td/telegram/files/FileDownloader.cpp b/td/telegram/files/FileDownloader.cpp index 38353df9..920c3f2c 100644 --- a/td/telegram/files/FileDownloader.cpp +++ b/td/telegram/files/FileDownloader.cpp @@ -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())); }