Adding user to their own contacts, reusing one database transaction

Fixes #15
This commit is contained in:
2020-02-07 09:34:02 +01:00
parent f2ac9bbf8e
commit bacc171ccd
4 changed files with 22 additions and 19 deletions

View File

@ -54,6 +54,7 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
// Create contacts
Contacts contacts = new Contacts(user.getId(),
user.getContacts().stream().map(envoy.server.data.User::toCommonUser).collect(Collectors.toList()));
contacts.getContacts().add(user.toCommonUser());
// Complete handshake
System.out.println("Sending user...");