Adding contacts technical aspects

* Contact SearchResult from server is now getting processed and
correctly displayed.
* Sending a AddContact event to server, if button is pressed.
* Added several interface objects
This commit is contained in:
DieGurke
2020-02-09 16:26:36 +01:00
parent 90409c1d90
commit e8062be346
6 changed files with 166 additions and 17 deletions

View File

@@ -11,11 +11,10 @@ import javax.naming.TimeLimitExceededException;
import envoy.client.Config;
import envoy.client.data.LocalDb;
import envoy.client.event.SearchResultEvent;
import envoy.client.util.EnvoyLog;
import envoy.data.*;
import envoy.event.Event;
import envoy.event.IdGeneratorRequest;
import envoy.event.MessageStatusChangeEvent;
import envoy.event.*;
import envoy.util.SerializationUtils;
/**
@@ -111,6 +110,9 @@ public class Client implements Closeable {
// Process message ID generation
receiver.registerProcessor(IdGenerator.class, localDb::setIdGenerator);
// Process contact searches
receiver.registerProcessor(Contacts.class, contacts -> EventBus.getInstance().dispatch(new SearchResultEvent(contacts.getContacts())));
// Request a generator if none is present or the existing one is consumed
if (!localDb.hasIdGenerator() || !localDb.getIdGenerator().hasNext()) requestIdGenerator();