Show organization is an extra privacy feature

pull/155/head
M66B 6 years ago
parent 0ce7db63aa
commit 541f97832d

@ -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

@ -1847,21 +1847,22 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
View view = LayoutInflater.from(context).inflate(R.layout.dialog_link, null);
final EditText etLink = view.findViewById(R.id.etLink);
final CheckBox cbOrganization = view.findViewById(R.id.cbOrganization);
TextView tvInsecure = view.findViewById(R.id.tvInsecure);
final TextView tvOwner = view.findViewById(R.id.tvOwner);
Group grpOwner = view.findViewById(R.id.grpOwner);
cbOrganization.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
prefs.edit().putBoolean("show_organization", isChecked).apply();
if (isChecked) {
etLink.setText(_uri.toString());
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<String>() {
@Override
protected void onPreExecute(Bundle args) {
cbOrganization.setText("…");
tvOwner.setText("…");
}
@Override
@ -1873,22 +1874,16 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override
protected void onExecuted(Bundle args, String organization) {
cbOrganization.setText(organization == null ? "?" : organization);
tvOwner.setText(organization == null ? "?" : organization);
}
@Override
protected void onException(Bundle args, Throwable ex) {
cbOrganization.setText(ex.getMessage());
tvOwner.setText(ex.getMessage());
}
}.execute(context, owner, args, "link:domain");
} else
cbOrganization.setText(R.string.title_show_organization);
}
});
etLink.setText(_uri.toString());
cbOrganization.setChecked(prefs.getBoolean("show_organization", true));
tvInsecure.setVisibility("http".equals(_uri.getScheme()) ? View.VISIBLE : View.GONE);
new DialogBuilderLifecycle(context, owner)
.setView(view)

@ -28,24 +28,42 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOpenLink" />
<CheckBox
android:id="@+id/cbOrganization"
<TextView
android:id="@+id/tvInsecure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_show_organization"
android:layout_marginTop="12dp"
android:text="@string/title_insecure_link"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etLink" />
<TextView
android:id="@+id/tvInsecure"
android:id="@+id/tvOwnerTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_insecure_link"
android:labelFor="@+id/etLink"
android:text="@string/title_ip_owner"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?attr/colorWarning"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbOrganization" />
app:layout_constraintTop_toBottomOf="@id/tvInsecure" />
<TextView
android:id="@+id/tvOwner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@+id/etLink"
android:text="Cloudflare"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOwnerTitle" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpOwner"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvOwnerTitle,tvOwner" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -593,7 +593,7 @@
<string name="title_hint_ignore_contact">Long press a contact to never consider it as a favorite</string>
<string name="title_open_link">Open link</string>
<string name="title_show_organization">Show organization</string>
<string name="title_ip_owner">Owner IP address</string>
<string name="title_insecure_link">This link is insecure</string>
<string name="title_select_app">Select app</string>
<string name="title_updated">There is an update to version %1$s available</string>

Loading…
Cancel
Save