mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Only allow new introductions in START state
When the user attempts an introduction, instead of the introduction message input field, an explanatory text will be shown and the introduction can not be made until the last one has been finished.
This commit is contained in:
@@ -23,6 +23,7 @@ import org.briarproject.bramble.api.sync.Group;
|
||||
import org.briarproject.bramble.api.sync.Message;
|
||||
import org.briarproject.bramble.api.sync.MessageId;
|
||||
import org.briarproject.bramble.test.TestDatabaseModule;
|
||||
import org.briarproject.briar.api.client.ProtocolStateException;
|
||||
import org.briarproject.briar.api.client.SessionId;
|
||||
import org.briarproject.briar.api.introduction.IntroductionManager;
|
||||
import org.briarproject.briar.api.introduction.IntroductionMessage;
|
||||
@@ -446,6 +447,26 @@ public class IntroductionIntegrationTest
|
||||
assertFalse(listener2.aborted);
|
||||
}
|
||||
|
||||
@Test(expected = ProtocolStateException.class)
|
||||
public void testDoubleIntroduction() throws Exception {
|
||||
// we can make an introduction
|
||||
assertTrue(introductionManager0
|
||||
.canIntroduce(contact1From0, contact2From0));
|
||||
|
||||
// make the introduction
|
||||
long time = clock.currentTimeMillis();
|
||||
introductionManager0
|
||||
.makeIntroduction(contact1From0, contact2From0, null, time);
|
||||
|
||||
// no more introduction allowed while the existing one is in progress
|
||||
assertFalse(introductionManager0
|
||||
.canIntroduce(contact1From0, contact2From0));
|
||||
|
||||
// try it anyway and fail
|
||||
introductionManager0
|
||||
.makeIntroduction(contact1From0, contact2From0, null, time);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntroducerRemovedCleanup() throws Exception {
|
||||
addListeners(true, true);
|
||||
|
||||
Reference in New Issue
Block a user