Updating status of received messages to RECEIVED

This commit is contained in:
Kai S. K. Engelbart 2020-02-05 16:12:10 +01:00
parent b6167ce166
commit 7d7dd02ceb

View File

@ -25,8 +25,12 @@ public class ReceivedMessageProcessor implements Consumer<Message> {
public void accept(Message message) { public void accept(Message message) {
logger.info("Received message object " + message); logger.info("Received message object " + message);
if (message.getStatus() != MessageStatus.SENT) logger.warning("The message has the unexpected status " + message.getStatus()); if (message.getStatus() != MessageStatus.SENT) logger.warning("The message has the unexpected status " + message.getStatus());
else else {
// Update status to RECEIVED
message.nextStatus();
// Dispatch event // Dispatch event
EventBus.getInstance().dispatch(new MessageCreationEvent(message)); EventBus.getInstance().dispatch(new MessageCreationEvent(message));
}
} }
} }