Default sync trash and archive

pull/23/head
M66B 6 years ago
parent 0aaf2e948f
commit 5ddf4fc994

@ -75,11 +75,20 @@ public class EntityFolder {
TYPE_DRAFTS,
TYPE_SENT,
TYPE_ARCHIVE,
TYPE_JUNK,
TYPE_TRASH,
TYPE_JUNK,
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) {
return (TYPE_OUTBOX.equals(type) || TYPE_DRAFTS.equals(type) || TYPE_SENT.equals(type));
}

@ -47,7 +47,6 @@ import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.mail.Folder;
@ -69,14 +68,6 @@ public class FragmentAccount extends FragmentEx {
private ProgressBar pbCheck;
// 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
@Nullable
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();
folder.name = ifolder.getFullName();
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);
Log.i(Helper.TAG, account.name +
@ -306,7 +297,7 @@ public class FragmentAccount extends FragmentEx {
inbox.name = "INBOX";
inbox.type = EntityFolder.TYPE_INBOX;
inbox.synchronize = true;
inbox.after = DEFAULT_INBOX_SYNC;
inbox.after = EntityFolder.DEFAULT_INBOX_SYNC;
folders.add(0, inbox);
for (EntityFolder folder : folders)

Loading…
Cancel
Save