1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-11 12:05:06 -05:00

add support for the new spam assassin filter option, so it actually works.

This commit is contained in:
Rob Savoye 2012-12-22 21:01:53 -07:00 committed by cketti
parent 2686993293
commit 8fc5e58288
2 changed files with 20 additions and 2 deletions

View File

@ -193,6 +193,7 @@ public class Account implements BaseAccount {
private boolean mReplyAfterQuote; private boolean mReplyAfterQuote;
private boolean mStripSignature; private boolean mStripSignature;
private boolean mSyncRemoteDeletions; private boolean mSyncRemoteDeletions;
private boolean mSpamassFilter;
private String mCryptoApp; private String mCryptoApp;
private boolean mCryptoAutoSignature; private boolean mCryptoAutoSignature;
private boolean mCryptoAutoEncrypt; private boolean mCryptoAutoEncrypt;
@ -302,6 +303,7 @@ public class Account implements BaseAccount {
mReplyAfterQuote = DEFAULT_REPLY_AFTER_QUOTE; mReplyAfterQuote = DEFAULT_REPLY_AFTER_QUOTE;
mStripSignature = DEFAULT_STRIP_SIGNATURE; mStripSignature = DEFAULT_STRIP_SIGNATURE;
mSyncRemoteDeletions = true; mSyncRemoteDeletions = true;
mSpamassFilter = true;
mCryptoApp = Apg.NAME; mCryptoApp = Apg.NAME;
mCryptoAutoSignature = false; mCryptoAutoSignature = false;
mCryptoAutoEncrypt = false; mCryptoAutoEncrypt = false;
@ -371,6 +373,7 @@ public class Account implements BaseAccount {
mSpamFolderName = prefs.getString(mUuid + ".spamFolderName", "Spam"); mSpamFolderName = prefs.getString(mUuid + ".spamFolderName", "Spam");
mExpungePolicy = prefs.getString(mUuid + ".expungePolicy", EXPUNGE_IMMEDIATELY); mExpungePolicy = prefs.getString(mUuid + ".expungePolicy", EXPUNGE_IMMEDIATELY);
mSyncRemoteDeletions = prefs.getBoolean(mUuid + ".syncRemoteDeletions", true); mSyncRemoteDeletions = prefs.getBoolean(mUuid + ".syncRemoteDeletions", true);
mSpamassFilter = prefs.getBoolean(mUuid + ".spamassFilter", true);
mMaxPushFolders = prefs.getInt(mUuid + ".maxPushFolders", 10); mMaxPushFolders = prefs.getInt(mUuid + ".maxPushFolders", 10);
goToUnreadMessageSearch = prefs.getBoolean(mUuid + ".goToUnreadMessageSearch", false); goToUnreadMessageSearch = prefs.getBoolean(mUuid + ".goToUnreadMessageSearch", false);
@ -698,6 +701,7 @@ public class Account implements BaseAccount {
editor.putBoolean(mUuid + ".signatureBeforeQuotedText", this.mIsSignatureBeforeQuotedText); editor.putBoolean(mUuid + ".signatureBeforeQuotedText", this.mIsSignatureBeforeQuotedText);
editor.putString(mUuid + ".expungePolicy", mExpungePolicy); editor.putString(mUuid + ".expungePolicy", mExpungePolicy);
editor.putBoolean(mUuid + ".syncRemoteDeletions", mSyncRemoteDeletions); editor.putBoolean(mUuid + ".syncRemoteDeletions", mSyncRemoteDeletions);
editor.putBoolean(mUuid + ".spamassfilter", mSpamassFilter);
editor.putInt(mUuid + ".maxPushFolders", mMaxPushFolders); editor.putInt(mUuid + ".maxPushFolders", mMaxPushFolders);
editor.putString(mUuid + ".searchableFolders", searchableFolders.name()); editor.putString(mUuid + ".searchableFolders", searchableFolders.name());
editor.putInt(mUuid + ".chipColor", mChipColor); editor.putInt(mUuid + ".chipColor", mChipColor);
@ -1706,6 +1710,14 @@ public class Account implements BaseAccount {
mSyncRemoteDeletions = syncRemoteDeletions; mSyncRemoteDeletions = syncRemoteDeletions;
} }
public synchronized boolean spamassFilter() {
return mSpamassFilter;
}
public synchronized void setSpamassFilter(boolean spamassFilter) {
mSpamassFilter = spamassFilter;
}
public synchronized String getLastSelectedFolderName() { public synchronized String getLastSelectedFolderName() {
return lastSelectedFolderName; return lastSelectedFolderName;
} }

View File

@ -109,6 +109,7 @@ public class AccountSettings extends K9PreferenceActivity {
private static final String PREFERENCE_STRIP_SIGNATURE = "strip_signature"; private static final String PREFERENCE_STRIP_SIGNATURE = "strip_signature";
private static final String PREFERENCE_SYNC_REMOTE_DELETIONS = "account_sync_remote_deletetions"; private static final String PREFERENCE_SYNC_REMOTE_DELETIONS = "account_sync_remote_deletetions";
private static final String PREFERENCE_CRYPTO = "crypto"; private static final String PREFERENCE_CRYPTO = "crypto";
private static final String PREFERENCE_SPAMASS = "account_spamass";
private static final String PREFERENCE_CRYPTO_APP = "crypto_app"; private static final String PREFERENCE_CRYPTO_APP = "crypto_app";
private static final String PREFERENCE_CRYPTO_AUTO_SIGNATURE = "crypto_auto_signature"; private static final String PREFERENCE_CRYPTO_AUTO_SIGNATURE = "crypto_auto_signature";
private static final String PREFERENCE_CRYPTO_AUTO_ENCRYPT = "crypto_auto_encrypt"; private static final String PREFERENCE_CRYPTO_AUTO_ENCRYPT = "crypto_auto_encrypt";
@ -171,6 +172,7 @@ public class AccountSettings extends K9PreferenceActivity {
private CheckBoxPreference mReplyAfterQuote; private CheckBoxPreference mReplyAfterQuote;
private CheckBoxPreference mStripSignature; private CheckBoxPreference mStripSignature;
private CheckBoxPreference mSyncRemoteDeletions; private CheckBoxPreference mSyncRemoteDeletions;
private CheckBoxPreference mSpamassFilter;
private CheckBoxPreference mPushPollOnConnect; private CheckBoxPreference mPushPollOnConnect;
private ListPreference mIdleRefreshPeriod; private ListPreference mIdleRefreshPeriod;
private ListPreference mMaxPushFolders; private ListPreference mMaxPushFolders;
@ -389,6 +391,9 @@ public class AccountSettings extends K9PreferenceActivity {
mSyncRemoteDeletions = (CheckBoxPreference) findPreference(PREFERENCE_SYNC_REMOTE_DELETIONS); mSyncRemoteDeletions = (CheckBoxPreference) findPreference(PREFERENCE_SYNC_REMOTE_DELETIONS);
mSyncRemoteDeletions.setChecked(mAccount.syncRemoteDeletions()); mSyncRemoteDeletions.setChecked(mAccount.syncRemoteDeletions());
mSpamassFilter = (CheckBoxPreference) findPreference(PREFERENCE_SPAMASS);
mSpamassFilter.setChecked(mAccount.spamassFilter());
mSearchableFolders = (ListPreference) findPreference(PREFERENCE_SEARCHABLE_FOLDERS); mSearchableFolders = (ListPreference) findPreference(PREFERENCE_SEARCHABLE_FOLDERS);
mSearchableFolders.setValue(mAccount.getSearchableFolders().name()); mSearchableFolders.setValue(mAccount.getSearchableFolders().name());
mSearchableFolders.setSummary(mSearchableFolders.getEntry()); mSearchableFolders.setSummary(mSearchableFolders.getEntry());
@ -756,6 +761,7 @@ public class AccountSettings extends K9PreferenceActivity {
mAccount.setExpungePolicy(mExpungePolicy.getValue()); mAccount.setExpungePolicy(mExpungePolicy.getValue());
} }
mAccount.setSyncRemoteDeletions(mSyncRemoteDeletions.isChecked()); mAccount.setSyncRemoteDeletions(mSyncRemoteDeletions.isChecked());
mAccount.setSpamassFilter(mSpamassFilter.isChecked());
mAccount.setSearchableFolders(Account.Searchable.valueOf(mSearchableFolders.getValue())); mAccount.setSearchableFolders(Account.Searchable.valueOf(mSearchableFolders.getValue()));
mAccount.setMessageFormat(Account.MessageFormat.valueOf(mMessageFormat.getValue())); mAccount.setMessageFormat(Account.MessageFormat.valueOf(mMessageFormat.getValue()));
mAccount.setAlwaysShowCcBcc(mAlwaysShowCcBcc.isChecked()); mAccount.setAlwaysShowCcBcc(mAlwaysShowCcBcc.isChecked());