Get ChatId from Message

This commit is contained in:
Hocuri
2020-04-06 10:50:10 +02:00
committed by holger krekel
parent fdc091319b
commit 6d89638ca4

View File

@@ -218,11 +218,19 @@ impl Job {
_ => { _ => {
// If we do not retry, add an info message to the chat // If we do not retry, add an info message to the chat
// Error 5.7.1 should definitely go here: Yandex sends 5.7.1 with a link when it thinks that the email is SPAM. // Error 5.7.1 should definitely go here: Yandex sends 5.7.1 with a link when it thinks that the email is SPAM.
chat::add_info_msg( match Message::load_from_db(context, MsgId::new(self.foreign_id)) {
Ok(message) => chat::add_info_msg(
context, context,
ChatId::new(self.foreign_id), message.chat_id,
err.to_string(), err.to_string(),
); ),
Err(e) => warn!(
context,
"couldn't load chat_id to inform user about SMTP error: {}",
e
),
};
Status::Finished(Err(format_err!("Permanent SMTP error: {}", err))) Status::Finished(Err(format_err!("Permanent SMTP error: {}", err)))
} }
} }