Save/encrypt on back

pull/214/head
M66B 7 months ago
parent b74cb1bae7
commit fe552fe1a6

@ -4983,9 +4983,16 @@ public class FragmentCompose extends FragmentBase {
if (!saved && isEmpty())
onAction(R.id.action_delete, "empty");
else {
boolean finish = EntityMessage.SMIME_SIGNENCRYPT.equals(encrypt) ||
EntityMessage.PGP_ENCRYPTONLY.equals(encrypt) ||
EntityMessage.PGP_SIGNENCRYPT.equals(encrypt);
Bundle extras = new Bundle();
extras.putBoolean("autosave", true);
extras.putBoolean("finish", finish);
onAction(R.id.action_save, extras, "exit");
if (!finish)
finish();
}
} else
@ -7094,7 +7101,8 @@ public class FragmentCompose extends FragmentBase {
(EntityMessage.SMIME_SIGNONLY.equals(draft.ui_encrypt) && action == R.id.action_send);
boolean needsEncryption = (dirty && !encrypted && shouldEncrypt);
boolean autosave = extras.getBoolean("autosave");
if (needsEncryption && !autosave) {
boolean finish = extras.getBoolean("finish");
if (needsEncryption && (!autosave || finish)) {
Log.i("Need encryption id=" + draft.id);
args.putBoolean("needsEncryption", true);
db.setTransactionSuccessful();
@ -7481,6 +7489,11 @@ public class FragmentCompose extends FragmentBase {
} else if (action == R.id.action_save) {
boolean autosave = extras.getBoolean("autosave");
boolean finish = extras.getBoolean("finish");
if (finish)
finish();
else
setFocus(
args.getInt("focus"),
args.getInt("start", -1),

Loading…
Cancel
Save