From 58b9ac808175b8cd0e7b27e834abc2b79cec8917 Mon Sep 17 00:00:00 2001 From: kske Date: Wed, 5 Feb 2020 16:12:10 +0100 Subject: [PATCH] Updating status of received messages to RECEIVED --- .../java/envoy/client/net/ReceivedMessageProcessor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/envoy/client/net/ReceivedMessageProcessor.java b/src/main/java/envoy/client/net/ReceivedMessageProcessor.java index 27b505e..ba0a386 100644 --- a/src/main/java/envoy/client/net/ReceivedMessageProcessor.java +++ b/src/main/java/envoy/client/net/ReceivedMessageProcessor.java @@ -25,8 +25,12 @@ public class ReceivedMessageProcessor implements Consumer { public void accept(Message message) { logger.info("Received message object " + message); 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 EventBus.getInstance().dispatch(new MessageCreationEvent(message)); + } } }