Simplification

pull/147/head
M66B 6 years ago
parent 86fbef7cda
commit 3d1b983bca

@ -1348,9 +1348,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (encrypted == null) {
EntityMessage message = db.message().getMessage(id);
if (message.content) {
String body = message.read(context);
if (body != null) {
// https://tools.ietf.org/html/rfc4880#section-6.2
int begin = body.indexOf(PGP_BEGIN_MESSAGE);
int end = body.indexOf(PGP_END_MESSAGE);
@ -1367,8 +1366,6 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
encrypted = new ByteArrayInputStream(section.getBytes());
}
}
}
}
if (encrypted == null)
throw new IllegalArgumentException(getString(R.string.title_not_encrypted));

@ -1392,7 +1392,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().findItem(R.id.menu_manage_keywords).setVisible(data.message.uid != null);
popupMenu.getMenu().findItem(R.id.menu_decrypt).setEnabled(data.message.to != null && data.message.to.length > 0);
popupMenu.getMenu().findItem(R.id.menu_decrypt).setEnabled(
data.message.content && data.message.to != null && data.message.to.length > 0);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override

Loading…
Cancel
Save