Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4a4a3bb authored by cketti's avatar cketti
Browse files

Get rid of ImapConnection.getCapabilities()

parent cf718c63
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -573,10 +573,6 @@ class ImapConnection {
        return capabilities.contains(CAPABILITY_IDLE);
    }

    public Set<String> getCapabilities() {
        return capabilities;
    }

    public void close() {
        IOUtils.closeQuietly(inputStream);
        IOUtils.closeQuietly(outputStream);
+2 −2
Original line number Diff line number Diff line
@@ -513,10 +513,10 @@ public class ImapStore extends RemoteStore {
        String commandResponse;
        String commandOptions = "";

        if (connection.getCapabilities().contains("XLIST")) {
        if (connection.hasCapability("XLIST")) {
            if (K9MailLib.isDebug()) Log.d(LOG_TAG, "Folder auto-configuration: Using XLIST.");
            commandResponse = "XLIST";
        } else if(connection.getCapabilities().contains("SPECIAL-USE")) {
        } else if(connection.hasCapability("SPECIAL-USE")) {
            if (K9MailLib.isDebug()) Log.d(LOG_TAG, "Folder auto-configuration: Using RFC6154/SPECIAL-USE.");
            commandResponse = "LIST";
            commandOptions = " (SPECIAL-USE)";
+0 −12
Original line number Diff line number Diff line
@@ -567,18 +567,6 @@ public class ImapConnectionTest {
        server.shutdown();
    }

    @Test
    public void getCapabilities_afterOpen_shouldReturnCapabilities() throws Exception {
        MockImapServer server = new MockImapServer();
        ImapConnection imapConnection = simpleOpenWithCapabilities(server, "IDLE X-LIST");

        Set<String> capabilities = imapConnection.getCapabilities();

        assertEquals(Sets.newSet("IMAP4", "IMAP4REV1", "IDLE", "X-LIST"), capabilities);

        server.shutdown();
    }

    @Test
    public void isIdleCapable_withoutIdleCapability() throws Exception {
        MockImapServer server = new MockImapServer();