mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Add local contacts for POP3 send
This commit is contained in:
parent
67b6b103dd
commit
6bbab65072
2 changed files with 16 additions and 6 deletions
|
@ -340,10 +340,13 @@ class Core {
|
||||||
|
|
||||||
case EntityOperation.ANSWERED:
|
case EntityOperation.ANSWERED:
|
||||||
case EntityOperation.ADD:
|
case EntityOperation.ADD:
|
||||||
case EntityOperation.EXISTS:
|
|
||||||
// Do nothing
|
// Do nothing
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EntityOperation.EXISTS:
|
||||||
|
onExists(context, jargs, account, folder, message);
|
||||||
|
break;
|
||||||
|
|
||||||
case EntityOperation.MOVE:
|
case EntityOperation.MOVE:
|
||||||
onMove(context, jargs, folder, message);
|
onMove(context, jargs, folder, message);
|
||||||
break;
|
break;
|
||||||
|
@ -1857,6 +1860,11 @@ class Core {
|
||||||
EntityLog.log(context, "Operation attachment size=" + attachment.size);
|
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 {
|
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);
|
DB db = DB.getInstance(context);
|
||||||
|
|
||||||
|
|
|
@ -100,11 +100,13 @@ public class EntityContact implements Serializable {
|
||||||
@NonNull EntityAccount account,
|
@NonNull EntityAccount account,
|
||||||
@NonNull EntityFolder folder,
|
@NonNull EntityFolder folder,
|
||||||
@NonNull EntityMessage message) {
|
@NonNull EntityMessage message) {
|
||||||
int days = (folder.isOutgoing() ? folder.keep_days : folder.sync_days);
|
if (account.protocol == EntityAccount.TYPE_IMAP) {
|
||||||
if (days == Integer.MAX_VALUE)
|
int days = (folder.isOutgoing() ? folder.keep_days : folder.sync_days);
|
||||||
days = EntityFolder.DEFAULT_KEEP;
|
if (days == Integer.MAX_VALUE)
|
||||||
if (message.received < account.created - days * 24 * 3600 * 1000L)
|
days = EntityFolder.DEFAULT_KEEP;
|
||||||
return;
|
if (message.received < account.created - days * 24 * 3600 * 1000L)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (EntityFolder.DRAFTS.equals(folder.type) ||
|
if (EntityFolder.DRAFTS.equals(folder.type) ||
|
||||||
EntityFolder.ARCHIVE.equals(folder.type) ||
|
EntityFolder.ARCHIVE.equals(folder.type) ||
|
||||||
|
|
Loading…
Reference in a new issue