Use MOVE again, refactored compose message, find by message ID

This commit is contained in:
M66B
2018-08-11 14:13:29 +00:00
parent 884ce9870a
commit 6f06d88082
8 changed files with 326 additions and 316 deletions

View File

@@ -45,6 +45,7 @@ import static androidx.room.ForeignKey.CASCADE;
@Index(value = {"identity"}),
@Index(value = {"replying"}),
@Index(value = {"folder", "uid"}, unique = true),
@Index(value = {"msgid"}, unique = true),
@Index(value = {"thread"}),
@Index(value = {"received"}),
@Index(value = {"ui_seen"}),
@@ -84,6 +85,17 @@ public class EntityMessage {
public Boolean ui_hide;
public String error;
String generateMessageId() {
StringBuffer sb = new StringBuffer();
sb.append('<')
.append(id).append('.')
.append(BuildConfig.APPLICATION_ID).append('.')
.append(System.currentTimeMillis()).append('.')
.append("anonymous@localhost")
.append('>');
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof EntityMessage) {