mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Do not create PeerSession for groups we created
This needs a CreatorSession which gets created on-demand.
This commit is contained in:
@@ -709,6 +709,30 @@ public class GroupInvitationIntegrationTest
|
||||
assertTrue(deleteMessages0From1(emptySet()).allDeleted());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvitationAfterReAddingContacts() throws Exception {
|
||||
// sync invitation and response back
|
||||
sendInvitation(c0.getClock().currentTimeMillis(), null);
|
||||
sync0To1(1, true);
|
||||
groupInvitationManager1
|
||||
.respondToInvitation(contactId0From1, privateGroup, true);
|
||||
sync1To0(1, true);
|
||||
|
||||
// sync group join messages
|
||||
sync0To1(2, true); // + one invitation protocol join message
|
||||
sync1To0(1, true);
|
||||
|
||||
assertFalse(groupInvitationManager0
|
||||
.isInvitationAllowed(contact1From0, privateGroup.getId()));
|
||||
|
||||
// re-add contacts
|
||||
removeAllContacts();
|
||||
addDefaultContacts();
|
||||
|
||||
assertTrue(groupInvitationManager0
|
||||
.isInvitationAllowed(contact1From0, privateGroup.getId()));
|
||||
}
|
||||
|
||||
private Collection<ConversationMessageHeader> getMessages1From0()
|
||||
throws DbException {
|
||||
return db0.transactionWithResult(true, txn -> groupInvitationManager0
|
||||
|
||||
@@ -196,6 +196,9 @@ public class GroupInvitationManagerImplTest extends BrambleMockTestCase {
|
||||
oneOf(privateGroupManager).isMember(txn, privateGroup.getId(),
|
||||
c.getAuthor());
|
||||
will(returnValue(true));
|
||||
oneOf(privateGroupManager)
|
||||
.isOurPrivateGroup(txn, privateGroup.getId());
|
||||
will(returnValue(false));
|
||||
}});
|
||||
expectAddingMember(privateGroup.getId(), c);
|
||||
}
|
||||
|
||||
@@ -523,10 +523,10 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
|
||||
contactManager0.removeContact(contactId2From0);
|
||||
contactManager1.removeContact(contactId0From1);
|
||||
contactManager2.removeContact(contactId0From2);
|
||||
assertNotNull(contactId2From1);
|
||||
contactManager1.removeContact(contactId2From1);
|
||||
assertNotNull(contactId1From2);
|
||||
contactManager2.removeContact(contactId1From2);
|
||||
if (contactId2From1 != null)
|
||||
contactManager1.removeContact(contactId2From1);
|
||||
if (contactId1From2 != null)
|
||||
contactManager2.removeContact(contactId1From2);
|
||||
}
|
||||
|
||||
protected void setAutoDeleteTimer(BriarIntegrationTestComponent component,
|
||||
|
||||
Reference in New Issue
Block a user