diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java
index eb12d73e69..126f80bb01 100644
--- a/app/src/main/java/eu/faircode/email/FragmentCompose.java
+++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java
@@ -1236,9 +1236,11 @@ public class FragmentCompose extends FragmentBase {
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ boolean save_drafts = prefs.getBoolean("save_drafts", true);
boolean send_dialog = prefs.getBoolean("send_dialog", true);
boolean image_dialog = prefs.getBoolean("image_dialog", true);
+ menu.findItem(R.id.menu_save_drafts).setChecked(save_drafts);
menu.findItem(R.id.menu_send_dialog).setChecked(send_dialog);
menu.findItem(R.id.menu_image_dialog).setChecked(image_dialog);
menu.findItem(R.id.menu_media).setChecked(media);
@@ -1263,6 +1265,9 @@ public class FragmentCompose extends FragmentBase {
case R.id.menu_zoom:
onMenuZoom();
return true;
+ case R.id.menu_save_drafts:
+ onMenuSaveDrafts();
+ return true;
case R.id.menu_send_dialog:
onMenuSendDialog();
return true;
@@ -1369,6 +1374,12 @@ public class FragmentCompose extends FragmentBase {
}
}
+ private void onMenuSaveDrafts() {
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
+ boolean save_drafts = prefs.getBoolean("save_drafts", true);
+ prefs.edit().putBoolean("save_drafts", !save_drafts).apply();
+ }
+
private void onMenuSendDialog() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean send_dialog = prefs.getBoolean("send_dialog", true);
@@ -4261,8 +4272,11 @@ public class FragmentCompose extends FragmentBase {
action == R.id.action_undo ||
action == R.id.action_redo ||
action == R.id.action_check) {
- if ((dirty || encrypted) && !needsEncryption)
- EntityOperation.queue(context, draft, EntityOperation.ADD);
+ if ((dirty || encrypted) && !needsEncryption) {
+ boolean save_drafts = prefs.getBoolean("save_drafts", true);
+ if (save_drafts)
+ EntityOperation.queue(context, draft, EntityOperation.ADD);
+ }
if (action == R.id.action_check) {
// Check data
diff --git a/app/src/main/res/menu/menu_compose.xml b/app/src/main/res/menu/menu_compose.xml
index 227f6fb0f3..4b4a30c5f2 100644
--- a/app/src/main/res/menu/menu_compose.xml
+++ b/app/src/main/res/menu/menu_compose.xml
@@ -13,6 +13,13 @@
android:title="@string/title_zoom"
app:showAsAction="ifRoom" />
+
+
- Record audio
Show CC/BCC
+ Save drafts on the server
Show send options
Show image options
Media toolbar