1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 03:05:31 +00:00

Add local contacts for POP3 send

This commit is contained in:
M66B 2021-10-27 07:45:00 +02:00
parent 67b6b103dd
commit 6bbab65072
2 changed files with 16 additions and 6 deletions

View file

@ -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);

View file

@ -100,11 +100,13 @@ public class EntityContact implements Serializable {
@NonNull EntityAccount account,
@NonNull EntityFolder folder,
@NonNull EntityMessage message) {
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 (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) ||