Updating status of received messages to RECEIVED
This commit is contained in:
parent
5e335a98bd
commit
58b9ac8081
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user