mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-05 16:43:26 +02:00
Added attachment section IDs
This commit is contained in:
@@ -204,6 +204,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
||||
sb.append(' ').append(attachment.cid);
|
||||
if (attachment.related != null)
|
||||
sb.append(' ').append(attachment.related);
|
||||
sb.append(' ').append(attachment.section).append('/').append(attachment.sequence);
|
||||
}
|
||||
if (attachment.isEncryption())
|
||||
sb.append(' ').append(attachment.encryption);
|
||||
|
||||
@@ -68,7 +68,7 @@ import javax.mail.internet.InternetAddress;
|
||||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 280,
|
||||
version = 281,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
@@ -2841,6 +2841,12 @@ public abstract class DB extends RoomDatabase {
|
||||
logMigration(startVersion, endVersion);
|
||||
db.execSQL("ALTER TABLE `folder` ADD COLUMN `flags` TEXT");
|
||||
}
|
||||
}).addMigrations(new Migration(280, 281) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
logMigration(startVersion, endVersion);
|
||||
db.execSQL("ALTER TABLE `attachment` ADD COLUMN `section` TEXT");
|
||||
}
|
||||
})
|
||||
.addMigrations(new Migration(998, 999) {
|
||||
@Override
|
||||
|
||||
@@ -78,6 +78,7 @@ public class EntityAttachment {
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
public Long id;
|
||||
public String section;
|
||||
@NonNull
|
||||
public Long message;
|
||||
@NonNull
|
||||
@@ -427,7 +428,8 @@ public class EntityAttachment {
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof EntityAttachment) {
|
||||
EntityAttachment other = (EntityAttachment) obj;
|
||||
return (this.message.equals(other.message) &&
|
||||
return (Objects.equals(this.section, other.section) &&
|
||||
this.message.equals(other.message) &&
|
||||
this.sequence.equals(other.sequence) &&
|
||||
Objects.equals(this.name, other.name) &&
|
||||
this.type.equals(other.type) &&
|
||||
|
||||
@@ -5040,6 +5040,8 @@ public class MessageHelper {
|
||||
}
|
||||
|
||||
apart.attachment = new EntityAttachment();
|
||||
if (part instanceof IMAPBodyPart)
|
||||
apart.attachment.section = ((IMAPBodyPart) part).getSectionId();
|
||||
apart.attachment.disposition = apart.disposition;
|
||||
apart.attachment.name = apart.filename;
|
||||
apart.attachment.type = contentType.getBaseType().toLowerCase(Locale.ROOT);
|
||||
|
||||
Reference in New Issue
Block a user