more cleanup & fixes

This commit is contained in:
nobody 2024-08-24 01:34:41 +02:00 committed by murmeldin
parent 233a263b89
commit 9a6b7f8685
2 changed files with 12 additions and 11 deletions

View file

@ -107,13 +107,14 @@ impl Email {
email = email.to(recipient.parse().unwrap());
}
email = email.message_id(Some(message_id.clone()));
let email =
if let Some(in_reply_to) = in_reply_to { email.in_reply_to(in_reply_to) } else { email }
.subject(subject)
.singlepart(
SinglePart::builder().header(header::ContentType::TEXT_PLAIN).body(body),
)
.unwrap();
let email = if let Some(in_reply_to) = in_reply_to {
email.in_reply_to(in_reply_to)
} else {
email
}
.subject(subject)
.singlepart(SinglePart::builder().header(header::ContentType::TEXT_PLAIN).body(body))
.unwrap();
if !self.is_dry_run {
let mailer = SmtpTransport::starttls_relay(&self.server)?

View file

@ -345,9 +345,9 @@ fn main() -> Result<(), Box<dyn Error>> {
// shutdown
config.set("state-last-run", &today.to_string())?;
if config.has_errors() {
return Err("There were errors while writing config values.".into());
Err("There were errors while writing config values.".into())
} else {
return Ok(());
Ok(())
}
}
@ -516,7 +516,7 @@ fn do_reminder(
};
let body_prefix = if old_toc == toc {
format!("Die Themen sind gleich geblieben. ")
} else if toc.is_empty() {
} else if old_toc.is_empty() {
format!("Es gibt Themen, die aktuelle Liste ist:\n\n{toc}\n\n")
} else {
format!("Es gab nochmal Änderungen, die aktualisierten Themen für das Plenum sind:\n\n{toc}\n\n")
@ -554,7 +554,7 @@ fn do_protocol(
wiki: &Mediawiki,
) -> Result<(), Box<dyn Error>> {
let (current_pad_id, pad_content, toc, n_topics) = get_pad_info(config, hedgedoc);
if toc.len() > 0 {
if !toc.is_empty() {
let human_date = plenum_day.format("%d.%m.%Y");
let pad_content = hedgedoc::strip_metadata(pad_content);
let subject = format!("Protokoll vom Plenum am {human_date}");