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:
@@ -51,6 +51,7 @@ import static org.briarproject.api.introduction.IntroductionConstants.NAME;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.NOT_OUR_RESPONSE;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.PUBLIC_KEY;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.REMOTE_AUTHOR_ID;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.REMOTE_AUTHOR_IS_US;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.ROLE;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCEE;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.SESSION_ID;
|
||||
@@ -239,6 +240,7 @@ public class IntroduceeManagerTest extends BriarTestCase {
|
||||
state.put(ANSWERED, false);
|
||||
state.put(EXISTS, true);
|
||||
state.put(REMOTE_AUTHOR_ID, introducee2.getAuthor().getId());
|
||||
state.put(REMOTE_AUTHOR_IS_US, false);
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(clock).currentTimeMillis();
|
||||
@@ -268,6 +270,10 @@ public class IntroduceeManagerTest extends BriarTestCase {
|
||||
introducer.getLocalAuthorId());
|
||||
will(returnValue(contactExists));
|
||||
|
||||
// checks if remote author is one of our identities
|
||||
oneOf(db).containsLocalAuthor(txn, introducee2.getAuthor().getId());
|
||||
will(returnValue(false));
|
||||
|
||||
// store session state
|
||||
oneOf(clientHelper)
|
||||
.addLocalMessage(txn, localStateMessage, clientId, state,
|
||||
|
||||
Reference in New Issue
Block a user