Browse Source

Default sync trash and archive

main
M66B 6 years ago
parent
commit
5ddf4fc994
2 changed files with 13 additions and 13 deletions
  1. +10
    -1
      app/src/main/java/eu/faircode/email/EntityFolder.java
  2. +3
    -12
      app/src/main/java/eu/faircode/email/FragmentAccount.java

+ 10
- 1
app/src/main/java/eu/faircode/email/EntityFolder.java View File

@ -75,11 +75,20 @@ public class EntityFolder {
TYPE_DRAFTS, TYPE_DRAFTS,
TYPE_SENT, TYPE_SENT,
TYPE_ARCHIVE, TYPE_ARCHIVE,
TYPE_JUNK,
TYPE_TRASH, TYPE_TRASH,
TYPE_JUNK,
TYPE_USER TYPE_USER
); );
static final int DEFAULT_INBOX_SYNC = 30;
static final int DEFAULT_STANDARD_SYNC = 7;
static final List<String> SYSTEM_FOLDER_SYNC = Arrays.asList(
EntityFolder.TYPE_ARCHIVE,
EntityFolder.TYPE_DRAFTS,
EntityFolder.TYPE_SENT
);
static boolean isOutgoing(String type) { static boolean isOutgoing(String type) {
return (TYPE_OUTBOX.equals(type) || TYPE_DRAFTS.equals(type) || TYPE_SENT.equals(type)); return (TYPE_OUTBOX.equals(type) || TYPE_DRAFTS.equals(type) || TYPE_SENT.equals(type));
} }


+ 3
- 12
app/src/main/java/eu/faircode/email/FragmentAccount.java View File

@ -47,7 +47,6 @@ import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore; import com.sun.mail.imap.IMAPStore;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import javax.mail.Folder; import javax.mail.Folder;
@ -69,14 +68,6 @@ public class FragmentAccount extends FragmentEx {
private ProgressBar pbCheck; private ProgressBar pbCheck;
// TODO: loading spinner // TODO: loading spinner
static final int DEFAULT_INBOX_SYNC = 30;
static final int DEFAULT_STANDARD_SYNC = 7;
private static final List<String> standard_sync = Arrays.asList(
EntityFolder.TYPE_DRAFTS,
EntityFolder.TYPE_SENT
);
@Override @Override
@Nullable @Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
@ -264,8 +255,8 @@ public class FragmentAccount extends FragmentEx {
EntityFolder folder = new EntityFolder(); EntityFolder folder = new EntityFolder();
folder.name = ifolder.getFullName(); folder.name = ifolder.getFullName();
folder.type = type; folder.type = type;
folder.synchronize = standard_sync.contains(folder.type);
folder.after = DEFAULT_STANDARD_SYNC;
folder.synchronize = EntityFolder.SYSTEM_FOLDER_SYNC.contains(folder.type);
folder.after = EntityFolder.DEFAULT_STANDARD_SYNC;
folders.add(folder); folders.add(folder);
Log.i(Helper.TAG, account.name + Log.i(Helper.TAG, account.name +
@ -306,7 +297,7 @@ public class FragmentAccount extends FragmentEx {
inbox.name = "INBOX"; inbox.name = "INBOX";
inbox.type = EntityFolder.TYPE_INBOX; inbox.type = EntityFolder.TYPE_INBOX;
inbox.synchronize = true; inbox.synchronize = true;
inbox.after = DEFAULT_INBOX_SYNC;
inbox.after = EntityFolder.DEFAULT_INBOX_SYNC;
folders.add(0, inbox); folders.add(0, inbox);
for (EntityFolder folder : folders) for (EntityFolder folder : folders)


Loading…
Cancel
Save