Adjusted to event system refactoring

This commit is contained in:
Kai S. K. Engelbart 2020-02-11 17:17:45 +01:00
parent 31c80492df
commit 4909a65464

View File

@ -5,6 +5,7 @@ import java.util.stream.Collectors;
import envoy.data.Contacts;
import envoy.event.ContactSearchRequest;
import envoy.event.ContactSearchResult;
import envoy.server.ConnectionManager;
import envoy.server.ObjectProcessor;
import envoy.server.data.User;
@ -32,7 +33,7 @@ public class ContactsRequestEventProcessor implements ObjectProcessor<ContactSea
@Override
public void process(ContactSearchRequest request, long socketId, ObjectWriteProxy writeProxy) throws IOException {
writeProxy.write(socketId,
new Contacts(PersistenceManager.getPersistenceManager()
new ContactSearchResult(PersistenceManager.getPersistenceManager()
.searchUsers(request.get(), ConnectionManager.getInstance().getUserIdBySocketId(socketId))
.stream()
.map(User::toCommonUser)