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 mStripSignature;
private boolean mSyncRemoteDeletions;
private boolean mSpamassFilter;
private String mCryptoApp;
private boolean mCryptoAutoSignature;
private boolean mCryptoAutoEncrypt;
@ -302,6 +303,7 @@ public class Account implements BaseAccount {
mReplyAfterQuote = DEFAULT_REPLY_AFTER_QUOTE;
mStripSignature = DEFAULT_STRIP_SIGNATURE;
mSyncRemoteDeletions = true;
mSpamassFilter = true;
mCryptoApp = Apg.NAME;
mCryptoAutoSignature = false;
mCryptoAutoEncrypt = false;
@ -371,7 +373,8 @@ public class Account implements BaseAccount {
mSpamFolderName = prefs.getString(mUuid + ".spamFolderName", "Spam");
mExpungePolicy = prefs.getString(mUuid + ".expungePolicy", EXPUNGE_IMMEDIATELY);
mSyncRemoteDeletions = prefs.getBoolean(mUuid + ".syncRemoteDeletions", true);
mSpamassFilter = prefs.getBoolean(mUuid + ".spamassFilter", true);
mMaxPushFolders = prefs.getInt(mUuid + ".maxPushFolders", 10);
goToUnreadMessageSearch = prefs.getBoolean(mUuid + ".goToUnreadMessageSearch", false);
mNotificationShowsUnreadCount = prefs.getBoolean(mUuid + ".notificationUnreadCount", true);
@ -698,6 +701,7 @@ public class Account implements BaseAccount {
editor.putBoolean(mUuid + ".signatureBeforeQuotedText", this.mIsSignatureBeforeQuotedText);
editor.putString(mUuid + ".expungePolicy", mExpungePolicy);
editor.putBoolean(mUuid + ".syncRemoteDeletions", mSyncRemoteDeletions);
editor.putBoolean(mUuid + ".spamassfilter", mSpamassFilter);
editor.putInt(mUuid + ".maxPushFolders", mMaxPushFolders);
editor.putString(mUuid + ".searchableFolders", searchableFolders.name());
editor.putInt(mUuid + ".chipColor", mChipColor);
@ -1706,7 +1710,15 @@ public class Account implements BaseAccount {
mSyncRemoteDeletions = syncRemoteDeletions;
}
public synchronized String getLastSelectedFolderName() {
public synchronized boolean spamassFilter() {
return mSpamassFilter;
}
public synchronized void setSpamassFilter(boolean spamassFilter) {
mSpamassFilter = spamassFilter;
}
public synchronized String getLastSelectedFolderName() {
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_SYNC_REMOTE_DELETIONS = "account_sync_remote_deletetions";
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_AUTO_SIGNATURE = "crypto_auto_signature";
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 mStripSignature;
private CheckBoxPreference mSyncRemoteDeletions;
private CheckBoxPreference mSpamassFilter;
private CheckBoxPreference mPushPollOnConnect;
private ListPreference mIdleRefreshPeriod;
private ListPreference mMaxPushFolders;
@ -389,6 +391,9 @@ public class AccountSettings extends K9PreferenceActivity {
mSyncRemoteDeletions = (CheckBoxPreference) findPreference(PREFERENCE_SYNC_REMOTE_DELETIONS);
mSyncRemoteDeletions.setChecked(mAccount.syncRemoteDeletions());
mSpamassFilter = (CheckBoxPreference) findPreference(PREFERENCE_SPAMASS);
mSpamassFilter.setChecked(mAccount.spamassFilter());
mSearchableFolders = (ListPreference) findPreference(PREFERENCE_SEARCHABLE_FOLDERS);
mSearchableFolders.setValue(mAccount.getSearchableFolders().name());
mSearchableFolders.setSummary(mSearchableFolders.getEntry());
@ -756,6 +761,7 @@ public class AccountSettings extends K9PreferenceActivity {
mAccount.setExpungePolicy(mExpungePolicy.getValue());
}
mAccount.setSyncRemoteDeletions(mSyncRemoteDeletions.isChecked());
mAccount.setSpamassFilter(mSpamassFilter.isChecked());
mAccount.setSearchableFolders(Account.Searchable.valueOf(mSearchableFolders.getValue()));
mAccount.setMessageFormat(Account.MessageFormat.valueOf(mMessageFormat.getValue()));
mAccount.setAlwaysShowCcBcc(mAlwaysShowCcBcc.isChecked());