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

Commit 49534f22 authored by Daniel Applebaum's avatar Daniel Applebaum
Browse files

Fixes Issue 834

Provide for setting Sent folder to -NONE- which suppresses actually
saving sent mail in any folder.

Also, eliminate logging which folders are not configured for pushing.
It was just too much logging.

parent 790ae2e2
Loading
Loading
Loading
Loading
+35 −25
Original line number Diff line number Diff line
@@ -3140,9 +3140,6 @@ public class MessagingController implements Runnable
            fp.add(FetchProfile.Item.ENVELOPE);
            fp.add(FetchProfile.Item.BODY);

            LocalFolder localSentFolder =
                (LocalFolder) localStore.getFolder(
                    account.getSentFolderName());
            if (K9.DEBUG)
                Log.i(K9.LOG_TAG, "Scanning folder '" + account.getOutboxFolderName() + "' (" + ((LocalFolder)localFolder).getId() + ") for messages to send");

@@ -3193,6 +3190,17 @@ public class MessagingController implements Runnable
                        {
                            l.synchronizeMailboxProgress(account, account.getSentFolderName(), progress, todo);
                        }
                        if (K9.FOLDER_NONE.equals(account.getSentFolderName()))
                        {
                            if (K9.DEBUG)
                                Log.i(K9.LOG_TAG, "Sent folder set to " + K9.FOLDER_NONE + ", deleting sent message");
                            message.setFlag(Flag.DELETED, true);
                        }
                        else
                        {
                            LocalFolder localSentFolder =
                                (LocalFolder) localStore.getFolder(
                                    account.getSentFolderName());
                            if (K9.DEBUG)
                                Log.i(K9.LOG_TAG, "Moving sent message to folder '" + account.getSentFolderName() + "' (" + localSentFolder.getId() + ") ");
    
@@ -3214,6 +3222,8 @@ public class MessagingController implements Runnable
                            queuePendingCommand(account, command);
                            processPendingCommands(account);
                        }
                        
                    }
                    catch (Exception e)
                    {
                        if (e instanceof MessagingException)
@@ -4421,7 +4431,7 @@ public class MessagingController implements Runnable
                if (folder.getName().equals(account.getErrorFolderName())
                        || folder.getName().equals(account.getOutboxFolderName()))
                {
                    if (K9.DEBUG)
                    if (K9.DEBUG && false)
                        Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
                              " which should never be pushed");

@@ -4436,7 +4446,7 @@ public class MessagingController implements Runnable
                if (modeMismatch(aDisplayMode, fDisplayClass))
                {
                    // Never push a folder that isn't displayed
                    if (K9.DEBUG)
                    if (K9.DEBUG && false)
                        Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
                              " which is in display class " + fDisplayClass + " while account is in display mode " + aDisplayMode);

@@ -4446,7 +4456,7 @@ public class MessagingController implements Runnable
                if (modeMismatch(aPushMode, fPushClass))
                {
                    // Do not push folders in the wrong class
                    if (K9.DEBUG)
                    if (K9.DEBUG && false)
                        Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
                              " which is in push mode " + fPushClass + " while account is in push mode " + aPushMode);

+4 −1
Original line number Diff line number Diff line
@@ -555,6 +555,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
    private void selectImapFolder(int activityCode)
    {
        String curFolder = null;
        boolean showFolderNone = false;
        switch (activityCode)
        {
            case SELECT_DRAFT_FOLDER:
@@ -562,9 +563,11 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
                break;
            case SELECT_SENT_FOLDER:
                curFolder = mImapFolderSent.getText().toString();
                showFolderNone = true;
                break;
            case SELECT_TRASH_FOLDER:
                curFolder = mImapFolderTrash.getText().toString();
                showFolderNone = true;
                break;
            default:
                throw new IllegalArgumentException(
@@ -573,7 +576,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener

        Intent selectIntent = new Intent(this, ChooseFolder.class);
        String uri = mAccount.getStoreUri();
        if (uri.startsWith("imap"))
        if (showFolderNone && uri.startsWith("imap"))
        {
            selectIntent.putExtra(ChooseFolder.EXTRA_SHOW_FOLDER_NONE, "yes");
        }