Prevent saving unencrypted messages

This commit is contained in:
M66B 2021-12-09 08:29:42 +01:00
parent 03ec67a389
commit 2c511dd0f5
1 changed files with 3 additions and 1 deletions

View File

@ -5742,7 +5742,9 @@ public class FragmentCompose extends FragmentBase {
action == R.id.action_undo ||
action == R.id.action_redo ||
action == R.id.action_check) {
if ((dirty || encrypted) && !needsEncryption) {
boolean unencrypted = (draft.ui_encrypt == null ||
EntityMessage.ENCRYPT_NONE.equals(draft.ui_encrypt));
if ((dirty && unencrypted) || encrypted) {
if (save_drafts) {
Map<String, String> c = new HashMap<>();
c.put("id", draft.id == null ? null : Long.toString(draft.id));