mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 06:08:31 +02:00
Virtual messages
This commit is contained in:
@@ -28,6 +28,7 @@ import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -36,6 +37,7 @@ import javax.mail.Address;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.ForeignKey;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.Index;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
@@ -64,7 +66,7 @@ import static androidx.room.ForeignKey.CASCADE;
|
||||
@Index(value = {"ui_hide"})
|
||||
}
|
||||
)
|
||||
public class EntityMessage {
|
||||
public class EntityMessage implements Serializable {
|
||||
static final String TABLE_NAME = "message";
|
||||
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
@@ -98,6 +100,11 @@ public class EntityMessage {
|
||||
public Boolean ui_hide;
|
||||
public String error;
|
||||
|
||||
@Ignore
|
||||
String body = null;
|
||||
@Ignore
|
||||
boolean virtual = false;
|
||||
|
||||
static String generateMessageId() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append('<')
|
||||
@@ -131,7 +138,9 @@ public class EntityMessage {
|
||||
}
|
||||
|
||||
String read(Context context) throws IOException {
|
||||
return read(context, this.id);
|
||||
if (body == null)
|
||||
body = read(context, this.id);
|
||||
return body;
|
||||
}
|
||||
|
||||
static String read(Context context, Long id) throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user