Added the UserStatusChangeProcessor and its implementation

this commit serves as solution to the merge conflict between
f/user_status_change_processor and develop
This commit is contained in:
delvh
2020-02-07 15:27:26 +01:00
parent 412b52ad00
commit 0aba82fd9f
3 changed files with 62 additions and 3 deletions

View File

@@ -14,9 +14,7 @@ import envoy.client.data.Config;
import envoy.client.data.LocalDb;
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;
/**
@@ -100,6 +98,8 @@ public class Client implements Closeable {
receiver.removeAllProcessors();
// Register processors for message and status handling
// Process incoming messages
final ReceivedMessageProcessor receivedMessageProcessor = new ReceivedMessageProcessor();
receiver.registerProcessor(Message.class, receivedMessageProcessor);
@@ -109,6 +109,9 @@ public class Client implements Closeable {
// Process message status changes
receiver.registerProcessor(MessageStatusChangeEvent.class, new MessageStatusChangeEventProcessor());
// Process user status changes
receiver.registerProcessor(UserStatusChangeEvent.class, new UserStatusChangeProcessor(this));
// Process message ID generation
receiver.registerProcessor(IdGenerator.class, localDb::setIdGenerator);
@@ -207,4 +210,16 @@ public class Client implements Closeable {
* @since Envoy v0.2-alpha
*/
public boolean isOnline() { return online; }
/**
* @return the contacts of this {@link Client}
* @since Envoy v0.3-alpha
*/
public Contacts getContacts() { return contacts; }
/**
* @param contacts the contacts to set
* @since Envoy v0.3-alpha
*/
public void setContacts(Contacts contacts) { this.contacts = contacts; }
}