Optional inbox (2)

This commit is contained in:
M66B
2021-02-07 21:19:31 +01:00
parent 89393d0299
commit 22a6d2a0eb
4 changed files with 3 additions and 44 deletions

View File

@@ -57,7 +57,6 @@ import androidx.lifecycle.Lifecycle;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputLayout;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.protocol.IMAPProtocol;
import java.net.UnknownHostException;
import java.util.ArrayList;
@@ -676,8 +675,8 @@ public class FragmentAccount extends FragmentBase {
certificate, fingerprint);
result.idle = iservice.hasCapability("IDLE");
result.utf8 = iservice.hasCapability("UTF8=ACCEPT");
boolean inbox = false;
for (Folder ifolder : iservice.getStore().getDefaultFolder().list("*")) {
// Check folder attributes
String fullName = ifolder.getFullName();
@@ -700,17 +699,6 @@ public class FragmentAccount extends FragmentBase {
folder = new EntityFolder(fullName, type);
result.folders.add(folder);
if (EntityFolder.INBOX.equals(type)) {
inbox = true;
result.utf8 = (Boolean) ((IMAPFolder) ifolder).doCommand(new IMAPFolder.ProtocolCommand() {
@Override
public Object doCommand(IMAPProtocol protocol) {
return protocol.supportsUtf8();
}
});
}
Log.i(folder.name + " id=" + folder.id +
" type=" + folder.type + " attr=" + TextUtils.join(",", attrs));
}
@@ -718,16 +706,6 @@ public class FragmentAccount extends FragmentBase {
EntityFolder.guessTypes(result.folders, iservice.getStore().getDefaultFolder().getSeparator());
if (!inbox) {
EntityFolder in = new EntityFolder();
in.name = EntityFolder.INBOX;
in.type = EntityFolder.INBOX;
in.setProperties();
in.selectable = false;
result.folders.add(in);
//throw new IllegalArgumentException(context.getString(R.string.title_no_inbox));
}
if (result.folders.size() > 0)
Collections.sort(result.folders, result.folders.get(0).getComparator(null));
}