diff --git a/FAQ.md b/FAQ.md index 6fe365bb5e..ad218f9a95 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1458,6 +1458,7 @@ FairEmail will try to select the best identity based on the *to* address of the The advanced option *extra privacy features* enables: +* Looking up the owner of the IP address of a link * Detection and removal of [tracking images](#user-content-faq82) * Removal of [Urchin Tracking Module (UTM) parameters](https://en.wikipedia.org/wiki/UTM_parameters) from links diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 2047531d7b..03969f3c95 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -1847,48 +1847,43 @@ public class AdapterMessage extends RecyclerView.Adapter() { - @Override - protected void onPreExecute(Bundle args) { - cbOrganization.setText("…"); - } - - @Override - protected String onExecute(Context context, Bundle args) throws Throwable { - Uri uri = args.getParcelable("uri"); - String host = uri.getHost(); - return (TextUtils.isEmpty(host) ? null : Helper.getOrganization(host)); - } - - @Override - protected void onExecuted(Bundle args, String organization) { - cbOrganization.setText(organization == null ? "?" : organization); - } - - @Override - protected void onException(Bundle args, Throwable ex) { - cbOrganization.setText(ex.getMessage()); - } - }.execute(context, owner, args, "link:domain"); - } else - cbOrganization.setText(R.string.title_show_organization); - } - }); + final TextView tvOwner = view.findViewById(R.id.tvOwner); + Group grpOwner = view.findViewById(R.id.grpOwner); etLink.setText(_uri.toString()); - cbOrganization.setChecked(prefs.getBoolean("show_organization", true)); tvInsecure.setVisibility("http".equals(_uri.getScheme()) ? View.VISIBLE : View.GONE); + grpOwner.setVisibility(paranoid ? View.VISIBLE : View.GONE); + + if (paranoid) { + Bundle args = new Bundle(); + args.putParcelable("uri", _uri); + + new SimpleTask() { + @Override + protected void onPreExecute(Bundle args) { + tvOwner.setText("…"); + } + + @Override + protected String onExecute(Context context, Bundle args) throws Throwable { + Uri uri = args.getParcelable("uri"); + String host = uri.getHost(); + return (TextUtils.isEmpty(host) ? null : Helper.getOrganization(host)); + } + + @Override + protected void onExecuted(Bundle args, String organization) { + tvOwner.setText(organization == null ? "?" : organization); + } + + @Override + protected void onException(Bundle args, Throwable ex) { + tvOwner.setText(ex.getMessage()); + } + }.execute(context, owner, args, "link:domain"); + } + new DialogBuilderLifecycle(context, owner) .setView(view) diff --git a/app/src/main/res/layout/dialog_link.xml b/app/src/main/res/layout/dialog_link.xml index 464cad3467..a69ee3a1a2 100644 --- a/app/src/main/res/layout/dialog_link.xml +++ b/app/src/main/res/layout/dialog_link.xml @@ -28,15 +28,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvOpenLink" /> - - + app:layout_constraintTop_toBottomOf="@id/etLink" /> + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cfd57b18df..5808e3fc63 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -593,7 +593,7 @@ Long press a contact to never consider it as a favorite Open link - Show organization + Owner IP address This link is insecure Select app There is an update to version %1$s available