Only use summary for quote if text is empty

For text messages, summary joins all lines into one, so multi-line quotes
look bad in Thunderbird.
This commit is contained in:
Alexander Krotov
2020-10-10 21:31:11 +03:00
committed by link2xt
parent bb50b9abe4
commit 69f159792e
2 changed files with 12 additions and 4 deletions

View File

@@ -764,8 +764,16 @@ impl Message {
self.param.set(Param::GuaranteeE2ee, "1");
}
self.param
.set(Param::Quote, quote.get_summarytext(context, 500).await);
let text = quote.get_text().unwrap_or_default();
self.param.set(
Param::Quote,
if text.is_empty() {
// Use summary, similar to "Image" to avoid sending empty quote.
quote.get_summarytext(context, 500).await
} else {
text
},
);
Ok(())
}