Keep recently stored messages

pull/187/head
M66B 4 years ago
parent 6648169757
commit 4a01010408

@ -798,7 +798,7 @@ public interface DaoMessage {
" AND NOT uid IS NULL" +
" AND (ui_seen OR :unseen)" +
" AND NOT ui_flagged" +
" AND (NOT ui_browsed OR stored < :before)" +
" AND stored < :before" + // moved, browsed
" AND ui_snoozed IS NULL")
int deleteMessagesBefore(long folder, long before, boolean unseen);
}

@ -238,6 +238,7 @@ public class EntityOperation {
Long identity = message.identity;
long uid = message.uid;
Boolean raw = message.raw;
Long stored = message.stored;
int notifying = message.notifying;
boolean fts = message.fts;
Integer importance = message.importance;
@ -256,6 +257,7 @@ public class EntityOperation {
message.identity = null;
message.uid = null;
message.raw = null;
message.stored = new Date().getTime();
message.notifying = 0;
message.fts = false;
if (reset_importance)
@ -273,6 +275,7 @@ public class EntityOperation {
message.ui_browsed = false;
message.error = null;
message.id = db.message().insertMessage(message);
File mtarget = message.getFile(context);
long tmpid = message.id;
jargs.put(2, tmpid);
@ -283,6 +286,7 @@ public class EntityOperation {
message.identity = identity;
message.uid = uid;
message.raw = raw;
message.stored = stored;
message.notifying = notifying;
message.fts = fts;
message.importance = importance;

Loading…
Cancel
Save