Remove CID on converting inline image to attachment

This commit is contained in:
M66B 2022-03-29 20:56:41 +02:00
parent 533d809893
commit baaed52144
2 changed files with 5 additions and 4 deletions

View File

@ -115,10 +115,10 @@ public interface DaoAttachment {
void setType(long id, String type);
@Query("UPDATE attachment" +
" SET disposition = :disposition" +
" SET disposition = :disposition, cid = :cid" +
" WHERE id = :id" +
" AND NOT (disposition IS :disposition)")
void setDisposition(long id, String disposition);
" AND NOT (disposition IS :disposition AND cid IS :cid)")
void setDisposition(long id, String disposition, String cid);
@Query("UPDATE attachment" +
" SET cid = :cid" +

View File

@ -5769,7 +5769,8 @@ public class FragmentCompose extends FragmentBase {
if (attachment.isInline() && attachment.isImage()) {
Log.i("Converting to attachment cid=" + attachment.cid);
attachment.disposition = Part.ATTACHMENT;
db.attachment().setDisposition(attachment.id, attachment.disposition);
attachment.cid = null;
db.attachment().setDisposition(attachment.id, attachment.disposition, attachment.cid);
dirty = true;
}
}