mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 06:01:12 +00:00
Fix attachment disposition
This commit is contained in:
parent
3747814289
commit
a8cf904f7f
1 changed files with 13 additions and 1 deletions
|
@ -2532,15 +2532,27 @@ public class FragmentCompose extends FragmentBase {
|
|||
} else if (ref != null &&
|
||||
("reply".equals(action) || "reply_all".equals(action) ||
|
||||
"forward".equals(action) || "editasnew".equals(action))) {
|
||||
|
||||
List<String> cid = new ArrayList<>();
|
||||
for (Element img : document.select("img")) {
|
||||
String src = img.attr("src");
|
||||
if (src.startsWith("cid:"))
|
||||
cid.add("<" + src.substring(4) + ">");
|
||||
}
|
||||
|
||||
int sequence = 0;
|
||||
List<EntityAttachment> attachments = db.attachment().getAttachments(ref.id);
|
||||
for (EntityAttachment attachment : attachments)
|
||||
if (attachment.encryption == null &&
|
||||
("forward".equals(action) || "editasnew".equals(action) ||
|
||||
(attachment.isInline() && attachment.isImage()))) {
|
||||
(cid.contains(attachment.cid) ||
|
||||
(attachment.isInline() && attachment.isImage())))) {
|
||||
if (attachment.available) {
|
||||
File source = attachment.getFile(context);
|
||||
|
||||
if (cid.contains(attachment.cid))
|
||||
attachment.disposition = Part.INLINE;
|
||||
|
||||
attachment.id = null;
|
||||
attachment.message = data.draft.id;
|
||||
attachment.sequence = ++sequence;
|
||||
|
|
Loading…
Reference in a new issue