From 286c5040c12c15f0433e491ff67b6abe5fabef4f Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 8 Oct 2018 17:28:06 +0300 Subject: [PATCH] Do not fail old messages sent to chat with self. GitOrigin-RevId: eb88cd12fb29a32c6088c6284babe73a3ad71e01 --- td/telegram/MessagesManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index a8ab94cf7..f82f0d40d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -22135,7 +22135,7 @@ MessagesManager::Message *MessagesManager::continue_send_message(DialogId dialog } auto can_send_status = can_send_message(dialog_id); - if (can_send_status.is_ok() && result_message->send_date < now - MAX_RESEND_DELAY) { + if (can_send_status.is_ok() && result_message->send_date < now - MAX_RESEND_DELAY && dialog_id != get_my_dialog_id()) { can_send_status = Status::Error(400, "Message is too old to be re-sent automatically"); } if (can_send_status.is_error()) { @@ -22318,7 +22318,7 @@ void MessagesManager::on_binlog_events(vector &&events) { } if (!have_input_peer(from_dialog_id, AccessRights::Read) || can_send_message(to_dialog_id).is_error() || - messages.empty() || messages[0]->send_date < now - MAX_RESEND_DELAY) { + messages.empty() || (messages[0]->send_date < now - MAX_RESEND_DELAY && to_dialog_id != get_my_dialog_id())) { LOG(WARNING) << "Can't continue forwarding " << messages.size() << " message(s) to " << to_dialog_id; binlog_erase(G()->td_db()->get_binlog(), event.id_); break;