1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-26 01:28:50 -05:00

removed code from previous commit disabling of syncing drafts to be encrypted.

This commit is contained in:
ashley willis 2011-11-19 13:34:26 -06:00
parent 51c662f0d0
commit c49d1ecc8e
7 changed files with 9 additions and 45 deletions

View File

@ -597,8 +597,6 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="account_settings_crypto_auto_signature_summary">Use the account\'s email address to guess the signature key.</string> <string name="account_settings_crypto_auto_signature_summary">Use the account\'s email address to guess the signature key.</string>
<string name="account_settings_crypto_auto_encrypt">Auto-encrypt</string> <string name="account_settings_crypto_auto_encrypt">Auto-encrypt</string>
<string name="account_settings_crypto_auto_encrypt_summary">Automatically set encrypt if a public key matches a recipient.</string> <string name="account_settings_crypto_auto_encrypt_summary">Automatically set encrypt if a public key matches a recipient.</string>
<string name="account_settings_crypto_dont_sync_drafts">Don\'t sync drafts</string>
<string name="account_settings_crypto_dont_sync_drafts_summary">Don\'t sync drafts marked to be encrypted. Must change drafts folder\'s sync and push class to none, or these drafts will be deleted!</string>
<string name="account_settings_mail_check_frequency_label">Folder poll frequency</string> <string name="account_settings_mail_check_frequency_label">Folder poll frequency</string>
<string name="account_settings_second_class_check_frequency_label">2nd class check frequency</string> <string name="account_settings_second_class_check_frequency_label">2nd class check frequency</string>

View File

@ -481,13 +481,6 @@
android:summary="@string/account_settings_crypto_auto_encrypt_summary" android:summary="@string/account_settings_crypto_auto_encrypt_summary"
android:dependency="crypto_app"/> android:dependency="crypto_app"/>
<CheckBoxPreference
android:persistent="false"
android:key="crypto_dont_sync_drafts"
android:title="@string/account_settings_crypto_dont_sync_drafts"
android:summary="@string/account_settings_crypto_dont_sync_drafts_summary"
android:dependency="crypto_app"/>
</PreferenceScreen> </PreferenceScreen>
</PreferenceScreen> </PreferenceScreen>

View File

@ -150,7 +150,6 @@ public class Account implements BaseAccount {
private String mCryptoApp; private String mCryptoApp;
private boolean mCryptoAutoSignature; private boolean mCryptoAutoSignature;
private boolean mCryptoAutoEncrypt; private boolean mCryptoAutoEncrypt;
private boolean mCryptoDontSyncDrafts;
private CryptoProvider mCryptoProvider = null; private CryptoProvider mCryptoProvider = null;
@ -243,7 +242,6 @@ public class Account implements BaseAccount {
mCryptoApp = Apg.NAME; mCryptoApp = Apg.NAME;
mCryptoAutoSignature = false; mCryptoAutoSignature = false;
mCryptoAutoEncrypt = false; mCryptoAutoEncrypt = false;
mCryptoDontSyncDrafts = false;
mEnabled = true; mEnabled = true;
searchableFolders = Searchable.ALL; searchableFolders = Searchable.ALL;
@ -413,7 +411,6 @@ public class Account implements BaseAccount {
mCryptoApp = prefs.getString(mUuid + ".cryptoApp", Apg.NAME); mCryptoApp = prefs.getString(mUuid + ".cryptoApp", Apg.NAME);
mCryptoAutoSignature = prefs.getBoolean(mUuid + ".cryptoAutoSignature", false); mCryptoAutoSignature = prefs.getBoolean(mUuid + ".cryptoAutoSignature", false);
mCryptoAutoEncrypt = prefs.getBoolean(mUuid + ".cryptoAutoEncrypt", false); mCryptoAutoEncrypt = prefs.getBoolean(mUuid + ".cryptoAutoEncrypt", false);
mCryptoDontSyncDrafts = prefs.getBoolean(mUuid + ".cryptoDontSyncDrafts", false);
mEnabled = prefs.getBoolean(mUuid + ".enabled", true); mEnabled = prefs.getBoolean(mUuid + ".enabled", true);
} }
@ -487,7 +484,6 @@ public class Account implements BaseAccount {
editor.remove(mUuid + ".cryptoApp"); editor.remove(mUuid + ".cryptoApp");
editor.remove(mUuid + ".cryptoAutoSignature"); editor.remove(mUuid + ".cryptoAutoSignature");
editor.remove(mUuid + ".cryptoAutoEncrypt"); editor.remove(mUuid + ".cryptoAutoEncrypt");
editor.remove(mUuid + ".cryptoDontSyncDrafts");
editor.remove(mUuid + ".enabled"); editor.remove(mUuid + ".enabled");
editor.remove(mUuid + ".enableMoveButtons"); editor.remove(mUuid + ".enableMoveButtons");
editor.remove(mUuid + ".hideMoveButtonsEnum"); editor.remove(mUuid + ".hideMoveButtonsEnum");
@ -652,7 +648,6 @@ public class Account implements BaseAccount {
editor.putString(mUuid + ".cryptoApp", mCryptoApp); editor.putString(mUuid + ".cryptoApp", mCryptoApp);
editor.putBoolean(mUuid + ".cryptoAutoSignature", mCryptoAutoSignature); editor.putBoolean(mUuid + ".cryptoAutoSignature", mCryptoAutoSignature);
editor.putBoolean(mUuid + ".cryptoAutoEncrypt", mCryptoAutoEncrypt); editor.putBoolean(mUuid + ".cryptoAutoEncrypt", mCryptoAutoEncrypt);
editor.putBoolean(mUuid + ".cryptoDontSyncDrafts", mCryptoAutoEncrypt);
editor.putBoolean(mUuid + ".enabled", mEnabled); editor.putBoolean(mUuid + ".enabled", mEnabled);
editor.putBoolean(mUuid + ".vibrate", mNotificationSetting.shouldVibrate()); editor.putBoolean(mUuid + ".vibrate", mNotificationSetting.shouldVibrate());
@ -1484,14 +1479,6 @@ public class Account implements BaseAccount {
mCryptoAutoEncrypt = cryptoAutoEncrypt; mCryptoAutoEncrypt = cryptoAutoEncrypt;
} }
public boolean isCryptoDontSyncDrafts() {
return mCryptoDontSyncDrafts;
}
public void setCryptoDontSyncDrafts(boolean cryptoDontSyncDrafts) {
mCryptoDontSyncDrafts = cryptoDontSyncDrafts;
}
public String getInboxFolderName() { public String getInboxFolderName() {
return mInboxFolderName; return mInboxFolderName;
} }

View File

@ -209,7 +209,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
private PgpData mPgpData = null; private PgpData mPgpData = null;
private boolean mAutoEncrypt = false; private boolean mAutoEncrypt = false;
private boolean mDontSyncDrafts = false;
private String mReferences; private String mReferences;
private String mInReplyTo; private String mInReplyTo;
@ -679,7 +678,6 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
} }
updateEncryptLayout(); updateEncryptLayout();
mAutoEncrypt = mAccount.isCryptoAutoEncrypt(); mAutoEncrypt = mAccount.isCryptoAutoEncrypt();
mDontSyncDrafts = mAccount.isCryptoDontSyncDrafts();
} else { } else {
mEncryptLayout.setVisibility(View.GONE); mEncryptLayout.setVisibility(View.GONE);
} }
@ -2914,8 +2912,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
} }
final MessagingController messagingController = MessagingController.getInstance(getApplication()); final MessagingController messagingController = MessagingController.getInstance(getApplication());
Message draftMessage = messagingController.saveDraft(mAccount, message, Message draftMessage = messagingController.saveDraft(mAccount, message);
mDontSyncDrafts && mEncryptCheckbox.isChecked());
mDraftUid = draftMessage.getUid(); mDraftUid = draftMessage.getUid();
// Don't display the toast if the user is just changing the orientation // Don't display the toast if the user is just changing the orientation

View File

@ -98,7 +98,6 @@ public class AccountSettings extends K9PreferenceActivity {
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";
private static final String PREFERENCE_CRYPTO_DONT_SYNC_DRAFTS = "crypto_dont_sync_drafts";
private static final String PREFERENCE_LOCAL_STORAGE_PROVIDER = "local_storage_provider"; private static final String PREFERENCE_LOCAL_STORAGE_PROVIDER = "local_storage_provider";
@ -164,7 +163,6 @@ public class AccountSettings extends K9PreferenceActivity {
private ListPreference mCryptoApp; private ListPreference mCryptoApp;
private CheckBoxPreference mCryptoAutoSignature; private CheckBoxPreference mCryptoAutoSignature;
private CheckBoxPreference mCryptoAutoEncrypt; private CheckBoxPreference mCryptoAutoEncrypt;
private CheckBoxPreference mCryptoDontSyncDrafts;
private ListPreference mLocalStorageProvider; private ListPreference mLocalStorageProvider;
@ -688,9 +686,6 @@ public class AccountSettings extends K9PreferenceActivity {
mCryptoAutoEncrypt = (CheckBoxPreference) findPreference(PREFERENCE_CRYPTO_AUTO_ENCRYPT); mCryptoAutoEncrypt = (CheckBoxPreference) findPreference(PREFERENCE_CRYPTO_AUTO_ENCRYPT);
mCryptoAutoEncrypt.setChecked(mAccount.isCryptoAutoEncrypt()); mCryptoAutoEncrypt.setChecked(mAccount.isCryptoAutoEncrypt());
mCryptoDontSyncDrafts = (CheckBoxPreference) findPreference(PREFERENCE_CRYPTO_DONT_SYNC_DRAFTS);
mCryptoDontSyncDrafts.setChecked(mAccount.isCryptoDontSyncDrafts());
handleCryptoAppDependencies(); handleCryptoAppDependencies();
} }
@ -698,11 +693,9 @@ public class AccountSettings extends K9PreferenceActivity {
if ("".equals(mCryptoApp.getValue())) { if ("".equals(mCryptoApp.getValue())) {
mCryptoAutoSignature.setEnabled(false); mCryptoAutoSignature.setEnabled(false);
mCryptoAutoEncrypt.setEnabled(false); mCryptoAutoEncrypt.setEnabled(false);
mCryptoDontSyncDrafts.setEnabled(false);
} else { } else {
mCryptoAutoSignature.setEnabled(true); mCryptoAutoSignature.setEnabled(true);
mCryptoAutoEncrypt.setEnabled(true); mCryptoAutoEncrypt.setEnabled(true);
mCryptoDontSyncDrafts.setEnabled(true);
} }
} }
@ -749,7 +742,6 @@ public class AccountSettings extends K9PreferenceActivity {
mAccount.setCryptoApp(mCryptoApp.getValue()); mAccount.setCryptoApp(mCryptoApp.getValue());
mAccount.setCryptoAutoSignature(mCryptoAutoSignature.isChecked()); mAccount.setCryptoAutoSignature(mCryptoAutoSignature.isChecked());
mAccount.setCryptoAutoEncrypt(mCryptoAutoEncrypt.isChecked()); mAccount.setCryptoAutoEncrypt(mCryptoAutoEncrypt.isChecked());
mAccount.setCryptoDontSyncDrafts(mCryptoDontSyncDrafts.isChecked());
mAccount.setLocalStorageProviderId(mLocalStorageProvider.getValue()); mAccount.setLocalStorageProviderId(mLocalStorageProvider.getValue());
// In webdav account we use the exact folder name also for inbox, // In webdav account we use the exact folder name also for inbox,

View File

@ -4059,7 +4059,7 @@ public class MessagingController implements Runnable {
* @param message Message to save. * @param message Message to save.
* @return Message representing the entry in the local store. * @return Message representing the entry in the local store.
*/ */
public Message saveDraft(final Account account, final Message message, final boolean dontSyncDraft) { public Message saveDraft(final Account account, final Message message) {
Message localMessage = null; Message localMessage = null;
try { try {
LocalStore localStore = account.getLocalStore(); LocalStore localStore = account.getLocalStore();
@ -4072,7 +4072,6 @@ public class MessagingController implements Runnable {
// Fetch the message back from the store. This is the Message that's returned to the caller. // Fetch the message back from the store. This is the Message that's returned to the caller.
localMessage = localFolder.getMessage(message.getUid()); localMessage = localFolder.getMessage(message.getUid());
localMessage.setFlag(Flag.X_DOWNLOADED_FULL, true); localMessage.setFlag(Flag.X_DOWNLOADED_FULL, true);
if (!dontSyncDraft) {
PendingCommand command = new PendingCommand(); PendingCommand command = new PendingCommand();
command.command = PENDING_COMMAND_APPEND; command.command = PENDING_COMMAND_APPEND;
command.arguments = new String[] { command.arguments = new String[] {
@ -4080,7 +4079,6 @@ public class MessagingController implements Runnable {
localMessage.getUid() localMessage.getUid()
}; };
queuePendingCommand(account, command); queuePendingCommand(account, command);
}
processPendingCommands(account); processPendingCommands(account);
} catch (MessagingException e) { } catch (MessagingException e) {

View File

@ -28,7 +28,6 @@ public class AccountSettings {
s.put("cryptoApp", new StringSetting(Apg.NAME)); s.put("cryptoApp", new StringSetting(Apg.NAME));
s.put("cryptoAutoSignature", new BooleanSetting(false)); s.put("cryptoAutoSignature", new BooleanSetting(false));
//s.put("cryptoAutoEncrypt", new BooleanSetting(false)); // added to version 3? //s.put("cryptoAutoEncrypt", new BooleanSetting(false)); // added to version 3?
//s.put("cryptoDontSyncDrafts", new BooleanSetting(false)); // added to version 3?
s.put("defaultQuotedTextShown", new BooleanSetting(Account.DEFAULT_QUOTED_TEXT_SHOWN)); s.put("defaultQuotedTextShown", new BooleanSetting(Account.DEFAULT_QUOTED_TEXT_SHOWN));
s.put("deletePolicy", new DeletePolicySetting(Account.DELETE_POLICY_NEVER)); s.put("deletePolicy", new DeletePolicySetting(Account.DELETE_POLICY_NEVER));
s.put("displayCount", new IntegerResourceSetting(K9.DEFAULT_VISIBLE_LIMIT, s.put("displayCount", new IntegerResourceSetting(K9.DEFAULT_VISIBLE_LIMIT,