Index: src/main.rs ================================================================== --- src/main.rs +++ src/main.rs @@ -94,11 +94,11 @@ reply.push(format!("**Subject:** `{}`", subject).into()); } else if let Some(thread) = mail.thread_name() { reply.push(format!("**Thread:** `{}`", thread).into()); } if let Some(from) = mail.from() { - reply.push(format!("**From:** `{:?}`", from).into()); + reply.push(format!("**From:** `{:?}`", address_into_iter(from).collect::>().join(", ")).into()); } if let Some(sender) = mail.sender() { reply.push(format!("**Sender:** `{:?}`", sender).into()); } reply.push("".into()); @@ -131,11 +131,13 @@ body = text; text_num = 1; } }; reply.push("```".into()); - reply.push(body); + for line in body.lines() { + reply.push(line.into()); + } reply.push("```".into()); // and let's coillect all other attachment parts let mut files_to_send = vec![]; /* @@ -155,11 +157,10 @@ } for chat in rcpt { core.send(chat, reply.join("\n")).await.unwrap(); for chunk in &files_to_send { - task::sleep(Duration::from_secs(5)).await; let data = chunk.contents().to_vec(); let obj = telegram_bot::types::InputFileUpload::with_data(data, "Attachment"); core.sendfile(chat, obj).await.unwrap(); } } @@ -200,24 +201,27 @@ } } pub async fn debug<'b, S>(&self, msg: S) -> Result<()> where S: Into> { + task::sleep(Duration::from_secs(5)).await; self.tg.send(SendMessage::new(self.default, msg) - .parse_mode(ParseMode::Html)).await?; + .parse_mode(ParseMode::Markdown)).await?; Ok(()) } pub async fn send<'b, S>(&self, to: UserId, msg: S) -> Result<()> where S: Into> { + task::sleep(Duration::from_secs(5)).await; self.tg.send(SendMessage::new(to, msg) - .parse_mode(ParseMode::Html)).await?; + .parse_mode(ParseMode::Markdown)).await?; Ok(()) } pub async fn sendfile(&self, to: UserId, chunk: V) -> Result<()> where V: Into { + task::sleep(Duration::from_secs(5)).await; self.tg.send(telegram_bot::SendDocument::new(to, chunk)).await?; Ok(()) } }