mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Report message not encrypted
This commit is contained in:
parent
ba49a8a411
commit
b2bbc756bc
2 changed files with 7 additions and 0 deletions
|
@ -948,9 +948,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
DB db = DB.getInstance(context);
|
||||
|
||||
// Find encrypted data
|
||||
boolean found = false;
|
||||
List<EntityAttachment> attachments = db.attachment().getAttachments(id);
|
||||
for (EntityAttachment attachment : attachments)
|
||||
if (attachment.available && "encrypted.asc".equals(attachment.name)) {
|
||||
found = true;
|
||||
|
||||
// Serialize encrypted data
|
||||
FileInputStream encrypted = new FileInputStream(EntityAttachment.getFile(context, attachment.id));
|
||||
ByteArrayOutputStream decrypted = new ByteArrayOutputStream();
|
||||
|
@ -1008,6 +1011,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
throw new IllegalArgumentException(getString(R.string.title_not_encrypted));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@
|
|||
<string name="title_encrypt">Encrypt</string>
|
||||
<string name="title_decrypt">Decrypt</string>
|
||||
<string name="title_no_openpgp">OpenKeychain not found</string>
|
||||
<string name="title_not_encrypted">Message is not encrypted</string>
|
||||
|
||||
<string name="title_search">Search</string>
|
||||
<string name="title_search_hint">Search on server</string>
|
||||
|
|
Loading…
Reference in a new issue