Remove inline images from plain-only messages

This commit is contained in:
M66B 2020-03-05 08:28:36 +01:00
parent cc87c0eebb
commit 1650d6c67d
1 changed files with 6 additions and 6 deletions

View File

@ -3854,11 +3854,12 @@ public class FragmentCompose extends FragmentBase {
} else if (action == R.id.action_send) {
// Remove unused inline images
List<String> cids = new ArrayList<>();
for (Element element : JsoupEx.parse(body).select("img")) {
String src = element.attr("src");
if (src.startsWith("cid:"))
cids.add("<" + src.substring(4) + ">");
}
if (!draft.plain_only)
for (Element element : JsoupEx.parse(body).select("img")) {
String src = element.attr("src");
if (src.startsWith("cid:"))
cids.add("<" + src.substring(4) + ">");
}
for (EntityAttachment attachment : new ArrayList<>(attachments))
if (attachment.isInline() && !cids.contains(attachment.cid)) {
@ -4034,7 +4035,6 @@ public class FragmentCompose extends FragmentBase {
}
}
private void setBusy(boolean busy) {
FragmentCompose.this.busy = busy;
Helper.setViewsEnabled(view, !busy);