mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Refactored IntroductionSucceededEvent into more generic ContactAddedRemotelyEvent
This commit is contained in:
@@ -30,7 +30,7 @@ import org.briarproject.briar.api.client.SessionId;
|
||||
import org.briarproject.briar.api.introduction.IntroductionRequest;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionAbortedEvent;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionRequestReceivedEvent;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionSucceededEvent;
|
||||
import org.briarproject.bramble.api.contact.event.ContactAddedRemotelyEvent;
|
||||
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.Map;
|
||||
@@ -453,7 +453,7 @@ class IntroduceeProtocolEngine
|
||||
s.getRemote().transportProperties);
|
||||
|
||||
// Broadcast IntroductionSucceededEvent, because contact got added
|
||||
IntroductionSucceededEvent e = new IntroductionSucceededEvent(c);
|
||||
ContactAddedRemotelyEvent e = new ContactAddedRemotelyEvent(c);
|
||||
txn.attach(e);
|
||||
} catch (ContactExistsException e) {
|
||||
// Ignore this, because the other introducee might have deleted us.
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.briarproject.briar.api.introduction.IntroductionResponse;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionAbortedEvent;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionRequestReceivedEvent;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionResponseReceivedEvent;
|
||||
import org.briarproject.briar.api.introduction.event.IntroductionSucceededEvent;
|
||||
import org.briarproject.bramble.api.contact.event.ContactAddedRemotelyEvent;
|
||||
import org.briarproject.briar.test.BriarIntegrationTest;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -1275,10 +1275,10 @@ public class IntroductionIntegrationTest
|
||||
// only broadcast for DECLINE messages in introducee role
|
||||
latestEvent = e;
|
||||
eventWaiter.resume();
|
||||
} else if (e instanceof IntroductionSucceededEvent) {
|
||||
} else if (e instanceof ContactAddedRemotelyEvent) {
|
||||
latestEvent = e;
|
||||
succeeded = true;
|
||||
Contact contact = ((IntroductionSucceededEvent) e).getContact();
|
||||
Contact contact = ((ContactAddedRemotelyEvent) e).getContact();
|
||||
eventWaiter
|
||||
.assertFalse(contact.getId().equals(contactId0From1));
|
||||
eventWaiter.resume();
|
||||
|
||||
Reference in New Issue
Block a user