mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 13:44:40 +00:00
Conditionally locally move
This commit is contained in:
parent
dc579b1309
commit
f595f28122
1 changed files with 11 additions and 1 deletions
|
@ -25,6 +25,7 @@ import org.json.JSONArray;
|
|||
import org.json.JSONException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -148,9 +149,18 @@ public class EntityOperation {
|
|||
if (!EntityFolder.ARCHIVE.equals(source.type) || EntityFolder.TRASH.equals(target.type))
|
||||
db.message().setMessageUiHide(message.id, true);
|
||||
|
||||
Calendar cal_keep = Calendar.getInstance();
|
||||
cal_keep.add(Calendar.DAY_OF_MONTH, -target.keep_days);
|
||||
cal_keep.set(Calendar.HOUR_OF_DAY, 0);
|
||||
cal_keep.set(Calendar.MINUTE, 0);
|
||||
cal_keep.set(Calendar.SECOND, 0);
|
||||
cal_keep.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
// Create copy without uid in target folder
|
||||
// Message with same msgid can be in archive and source folder
|
||||
if (db.message().countMessageByMsgId(target.id, message.msgid) == 0) {
|
||||
if (target.synchronize &&
|
||||
message.received > cal_keep.getTimeInMillis() &&
|
||||
db.message().countMessageByMsgId(target.id, message.msgid) == 0) {
|
||||
long id = message.id;
|
||||
long uid = message.uid;
|
||||
message.id = null;
|
||||
|
|
Loading…
Reference in a new issue