Add local contacts for POP3 send

pull/194/merge
M66B 3 years ago
parent 67b6b103dd
commit 6bbab65072

@ -340,10 +340,13 @@ class Core {
case EntityOperation.ANSWERED:
case EntityOperation.ADD:
case EntityOperation.EXISTS:
// Do nothing
break;
case EntityOperation.EXISTS:
onExists(context, jargs, account, folder, message);
break;
case EntityOperation.MOVE:
onMove(context, jargs, folder, message);
break;
@ -1857,6 +1860,11 @@ class Core {
EntityLog.log(context, "Operation attachment size=" + attachment.size);
}
private static void onExists(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message) {
// POP3
EntityContact.received(context, account, folder, message);
}
private static void onExists(Context context, JSONArray jargs, EntityAccount account, EntityFolder folder, EntityMessage message, EntityOperation op, IMAPFolder ifolder) throws MessagingException, IOException {
DB db = DB.getInstance(context);

@ -100,11 +100,13 @@ public class EntityContact implements Serializable {
@NonNull EntityAccount account,
@NonNull EntityFolder folder,
@NonNull EntityMessage message) {
if (account.protocol == EntityAccount.TYPE_IMAP) {
int days = (folder.isOutgoing() ? folder.keep_days : folder.sync_days);
if (days == Integer.MAX_VALUE)
days = EntityFolder.DEFAULT_KEEP;
if (message.received < account.created - days * 24 * 3600 * 1000L)
return;
}
if (EntityFolder.DRAFTS.equals(folder.type) ||
EntityFolder.ARCHIVE.equals(folder.type) ||

Loading…
Cancel
Save