@Test public void testAddingContact() throws Exception { expectAddingContact(contact); groupInvitationManager.addingContact(txn, contact); }
@Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); Visibility client = clientVersioningManager.getClientVisibility(txn, c.getId(), CLIENT_ID, MAJOR_VERSION); db.setGroupVisibility(txn, c.getId(), g.getId(), client); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID, PrivateGroupManager.MAJOR_VERSION)) { if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor())) addingMember(txn, pg.getId(), c); } }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); Visibility client = clientVersioningManager.getClientVisibility(txn, c.getId(), CLIENT_ID, MAJOR_VERSION); db.setGroupVisibility(txn, c.getId(), g.getId(), client); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID, PrivateGroupManager.MAJOR_VERSION)) { if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor())) addingMember(txn, pg.getId(), c); } } }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); Visibility client = clientVersioningManager.getClientVisibility(txn, c.getId(), CLIENT_ID, MAJOR_VERSION); db.setGroupVisibility(txn, c.getId(), g.getId(), client); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID, PrivateGroupManager.MAJOR_VERSION)) { if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor())) addingMember(txn, pg.getId(), c); } } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); Visibility client = clientVersioningManager.getClientVisibility(txn, c.getId(), CLIENT_ID, MAJOR_VERSION); db.setGroupVisibility(txn, c.getId(), g.getId(), client); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID, PrivateGroupManager.MAJOR_VERSION)) { if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor())) addingMember(txn, pg.getId(), c); } } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override Group getContactGroup(Contact c); @Override void sendInvitation(GroupId privateGroupId, ContactId c,
			@Nullable String message, long timestamp, byte[] signature); @Override void respondToInvitation(ContactId c, PrivateGroup g, boolean accept); @Override void respondToInvitation(ContactId c, SessionId sessionId,
			boolean accept); @Override void revealRelationship(ContactId c, GroupId g); @Override Collection<InvitationMessage> getInvitationMessages(ContactId c); @Override Collection<GroupInvitationItem> getInvitations(); @Override boolean isInvitationAllowed(Contact c, GroupId privateGroupId); @Override void addingMember(Transaction txn, GroupId privateGroupId, Author a); @Override void removingGroup(Transaction txn, GroupId privateGroupId); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v); }
GroupInvitationManagerImpl extends ConversationClientImpl implements GroupInvitationManager, Client, ContactHook,
		PrivateGroupHook, ClientVersioningHook { @Override public void addingContact(Transaction txn, Contact c) throws DbException { Group g = getContactGroup(c); db.addGroup(txn, g); Visibility client = clientVersioningManager.getClientVisibility(txn, c.getId(), CLIENT_ID, MAJOR_VERSION); db.setGroupVisibility(txn, c.getId(), g.getId(), client); BdfDictionary meta = new BdfDictionary(); meta.put(GROUP_KEY_CONTACT_ID, c.getId().getInt()); try { clientHelper.mergeGroupMetadata(txn, g.getId(), meta); } catch (FormatException e) { throw new AssertionError(e); } for (Group pg : db.getGroups(txn, PrivateGroupManager.CLIENT_ID, PrivateGroupManager.MAJOR_VERSION)) { if (privateGroupManager.isMember(txn, pg.getId(), c.getAuthor())) addingMember(txn, pg.getId(), c); } } @Inject  GroupInvitationManagerImpl(DatabaseComponent db,
			ClientHelper clientHelper,
			ClientVersioningManager clientVersioningManager,
			MetadataParser metadataParser, MessageTracker messageTracker,
			ContactGroupFactory contactGroupFactory,
			PrivateGroupFactory privateGroupFactory,
			PrivateGroupManager privateGroupManager,
			MessageParser messageParser, SessionParser sessionParser,
			SessionEncoder sessionEncoder,
			ProtocolEngineFactory engineFactory); @Override void createLocalState(Transaction txn); @Override void addingContact(Transaction txn, Contact c); @Override void removingContact(Transaction txn, Contact c); @Override Group getContactGroup(Contact c); @Override void sendInvitation(GroupId privateGroupId, ContactId c,
			@Nullable String message, long timestamp, byte[] signature); @Override void respondToInvitation(ContactId c, PrivateGroup g, boolean accept); @Override void respondToInvitation(ContactId c, SessionId sessionId,
			boolean accept); @Override void revealRelationship(ContactId c, GroupId g); @Override Collection<InvitationMessage> getInvitationMessages(ContactId c); @Override Collection<GroupInvitationItem> getInvitations(); @Override boolean isInvitationAllowed(Contact c, GroupId privateGroupId); @Override void addingMember(Transaction txn, GroupId privateGroupId, Author a); @Override void removingGroup(Transaction txn, GroupId privateGroupId); @Override void onClientVisibilityChanging(Transaction txn, Contact c,
			Visibility v);  }