mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
This addresses two types of introduction corner cases:
* force decline when two of our own identities are introduced to each other * throw away introduction requests to the same identity (impossible to trigger from UI) Closes #284
This commit is contained in:
@@ -261,15 +261,23 @@ class ConversationAdapter extends RecyclerView.Adapter {
|
||||
contactName, ir.getName()));
|
||||
}
|
||||
|
||||
ui.acceptButton.setVisibility(View.VISIBLE);
|
||||
ui.acceptButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
intro.respondToIntroduction(ir.getSessionId(), true);
|
||||
item.setAnswered(true);
|
||||
notifyItemChanged(position);
|
||||
}
|
||||
});
|
||||
if (item.getIntroductionRequest().doesIntroduceOtherIdentity()) {
|
||||
// don't allow accept when one of our identities is introduced
|
||||
ui.acceptButton.setVisibility(View.GONE);
|
||||
ui.text.setText(ctx.getString(
|
||||
R.string.introduction_request_for_our_identity_received,
|
||||
contactName, ir.getName()));
|
||||
} else {
|
||||
ui.acceptButton.setVisibility(View.VISIBLE);
|
||||
ui.acceptButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
intro.respondToIntroduction(ir.getSessionId(), true);
|
||||
item.setAnswered(true);
|
||||
notifyItemChanged(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
ui.declineButton.setVisibility(View.VISIBLE);
|
||||
ui.declineButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user