mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 08:26:30 +03:00
Get ChatId from Message
This commit is contained in:
18
src/job.rs
18
src/job.rs
@@ -218,11 +218,19 @@ impl Job {
|
||||
_ => {
|
||||
// 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.
|
||||
chat::add_info_msg(
|
||||
context,
|
||||
ChatId::new(self.foreign_id),
|
||||
err.to_string(),
|
||||
);
|
||||
match Message::load_from_db(context, MsgId::new(self.foreign_id)) {
|
||||
Ok(message) => chat::add_info_msg(
|
||||
context,
|
||||
message.chat_id,
|
||||
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)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user