mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Show dialog when user tries to add contact with their own link
This commit is contained in:
@@ -6,6 +6,7 @@ import android.content.Intent;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -178,8 +179,22 @@ public class ContactLinkExchangeFragment extends BaseFragment
|
|||||||
ContactLinkExchangeActivity activity = getCastActivity();
|
ContactLinkExchangeActivity activity = getCastActivity();
|
||||||
if (activity == null) return;
|
if (activity == null) return;
|
||||||
|
|
||||||
|
String linkText = linkInput.getText().toString();
|
||||||
|
if (linkText.equals(OUR_LINK)) {
|
||||||
|
new AlertDialog.Builder(activity, R.style.BriarDialogTheme_Neutral)
|
||||||
|
.setMessage(
|
||||||
|
"Add the link you get from your contact, not your own link.")
|
||||||
|
.setNeutralButton(R.string.ok,
|
||||||
|
(dialog, which) -> {
|
||||||
|
linkInput.setText(null);
|
||||||
|
dialog.cancel();
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
activity.addFakeRequest(contactNameInput.getText().toString(),
|
activity.addFakeRequest(contactNameInput.getText().toString(),
|
||||||
linkInput.getText().toString());
|
linkText);
|
||||||
|
|
||||||
Intent intent = new Intent(activity, PendingRequestsActivity.class);
|
Intent intent = new Intent(activity, PendingRequestsActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|||||||
Reference in New Issue
Block a user