Fixed inline attachments

This commit is contained in:
M66B
2019-01-06 12:18:17 +00:00
parent 9154945de9
commit 7cc1f076f4
6 changed files with 17 additions and 7 deletions

View File

@@ -112,7 +112,6 @@ public class EntityAttachment {
InputStream is = null;
OutputStream os = null;
try {
this.progress = null;
db.attachment().setProgress(this.id, null);
is = this.part.getInputStream();
@@ -130,15 +129,11 @@ public class EntityAttachment {
}
// Store attachment data
this.size = size;
this.progress = null;
this.available = true;
db.attachment().setDownloaded(this.id, size);
Log.i("Downloaded attachment size=" + this.size);
} catch (IOException ex) {
// Reset progress on failure
this.progress = null;
db.attachment().setProgress(this.id, null);
throw ex;
} finally {
@@ -160,6 +155,9 @@ public class EntityAttachment {
this.sequence.equals(other.sequence) &&
(this.name == null ? other.name == null : this.name.equals(other.name)) &&
this.type.equals(other.type) &&
(this.disposition == null ? other.disposition == null : this.disposition.equals(other.disposition)) &&
(this.cid == null ? other.cid == null : this.cid.equals(other.cid)) &&
(this.encryption == null ? other.encryption == null : this.encryption.equals(other.encryption)) &&
(this.size == null ? other.size == null : this.size.equals(other.size)) &&
(this.progress == null ? other.progress == null : this.progress.equals(other.progress)) &&
this.available.equals(other.available));