mirror of
https://github.com/moparisthebest/k-9
synced 2025-03-02 09:31:49 -05:00
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.
This commit is contained in:
parent
790ae2e25c
commit
49534f22fc
src/com/fsck/k9
@ -3140,9 +3140,6 @@ public class MessagingController implements Runnable
|
|||||||
fp.add(FetchProfile.Item.ENVELOPE);
|
fp.add(FetchProfile.Item.ENVELOPE);
|
||||||
fp.add(FetchProfile.Item.BODY);
|
fp.add(FetchProfile.Item.BODY);
|
||||||
|
|
||||||
LocalFolder localSentFolder =
|
|
||||||
(LocalFolder) localStore.getFolder(
|
|
||||||
account.getSentFolderName());
|
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Scanning folder '" + account.getOutboxFolderName() + "' (" + ((LocalFolder)localFolder).getId() + ") for messages to send");
|
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);
|
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)
|
if (K9.DEBUG)
|
||||||
Log.i(K9.LOG_TAG, "Moving sent message to folder '" + account.getSentFolderName() + "' (" + localSentFolder.getId() + ") ");
|
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);
|
queuePendingCommand(account, command);
|
||||||
processPendingCommands(account);
|
processPendingCommands(account);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (e instanceof MessagingException)
|
if (e instanceof MessagingException)
|
||||||
@ -4421,7 +4431,7 @@ public class MessagingController implements Runnable
|
|||||||
if (folder.getName().equals(account.getErrorFolderName())
|
if (folder.getName().equals(account.getErrorFolderName())
|
||||||
|| folder.getName().equals(account.getOutboxFolderName()))
|
|| folder.getName().equals(account.getOutboxFolderName()))
|
||||||
{
|
{
|
||||||
if (K9.DEBUG)
|
if (K9.DEBUG && false)
|
||||||
Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
|
Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
|
||||||
" which should never be pushed");
|
" which should never be pushed");
|
||||||
|
|
||||||
@ -4436,7 +4446,7 @@ public class MessagingController implements Runnable
|
|||||||
if (modeMismatch(aDisplayMode, fDisplayClass))
|
if (modeMismatch(aDisplayMode, fDisplayClass))
|
||||||
{
|
{
|
||||||
// Never push a folder that isn't displayed
|
// 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() +
|
Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
|
||||||
" which is in display class " + fDisplayClass + " while account is in display mode " + aDisplayMode);
|
" 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))
|
if (modeMismatch(aPushMode, fPushClass))
|
||||||
{
|
{
|
||||||
// Do not push folders in the wrong class
|
// 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() +
|
Log.v(K9.LOG_TAG, "Not pushing folder " + folder.getName() +
|
||||||
" which is in push mode " + fPushClass + " while account is in push mode " + aPushMode);
|
" which is in push mode " + fPushClass + " while account is in push mode " + aPushMode);
|
||||||
|
|
||||||
|
@ -555,6 +555,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
|
|||||||
private void selectImapFolder(int activityCode)
|
private void selectImapFolder(int activityCode)
|
||||||
{
|
{
|
||||||
String curFolder = null;
|
String curFolder = null;
|
||||||
|
boolean showFolderNone = false;
|
||||||
switch (activityCode)
|
switch (activityCode)
|
||||||
{
|
{
|
||||||
case SELECT_DRAFT_FOLDER:
|
case SELECT_DRAFT_FOLDER:
|
||||||
@ -562,9 +563,11 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
|
|||||||
break;
|
break;
|
||||||
case SELECT_SENT_FOLDER:
|
case SELECT_SENT_FOLDER:
|
||||||
curFolder = mImapFolderSent.getText().toString();
|
curFolder = mImapFolderSent.getText().toString();
|
||||||
|
showFolderNone = true;
|
||||||
break;
|
break;
|
||||||
case SELECT_TRASH_FOLDER:
|
case SELECT_TRASH_FOLDER:
|
||||||
curFolder = mImapFolderTrash.getText().toString();
|
curFolder = mImapFolderTrash.getText().toString();
|
||||||
|
showFolderNone = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
@ -573,7 +576,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
|
|||||||
|
|
||||||
Intent selectIntent = new Intent(this, ChooseFolder.class);
|
Intent selectIntent = new Intent(this, ChooseFolder.class);
|
||||||
String uri = mAccount.getStoreUri();
|
String uri = mAccount.getStoreUri();
|
||||||
if (uri.startsWith("imap"))
|
if (showFolderNone && uri.startsWith("imap"))
|
||||||
{
|
{
|
||||||
selectIntent.putExtra(ChooseFolder.EXTRA_SHOW_FOLDER_NONE, "yes");
|
selectIntent.putExtra(ChooseFolder.EXTRA_SHOW_FOLDER_NONE, "yes");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user