From d5b7bcc3019a77cd6c56bc0f5cf2558e16b45285 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Wed, 5 Feb 2020 16:15:01 +0100 Subject: [PATCH] Propagating message received update to sender --- src/main/java/envoy/server/processors/MessageProcessor.java | 2 ++ .../envoy/server/processors/MessageStatusChangeProcessor.java | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/envoy/server/processors/MessageProcessor.java b/src/main/java/envoy/server/processors/MessageProcessor.java index ad3bc54..0d9a7e6 100644 --- a/src/main/java/envoy/server/processors/MessageProcessor.java +++ b/src/main/java/envoy/server/processors/MessageProcessor.java @@ -4,6 +4,7 @@ import java.io.IOException; import java.util.Date; import envoy.data.Message; +import envoy.event.MessageStatusChangeEvent; import envoy.server.ConnectionManager; import envoy.server.ObjectProcessor; import envoy.server.database.PersistenceManager; @@ -36,6 +37,7 @@ public class MessageProcessor implements ObjectProcessor { // Update the message status to RECEIVED message.setReceivedDate(new Date()); message.nextStatus(); + writeProxy.write(connectionManager.getSocketId(message.getSenderId()), new MessageStatusChangeEvent(message)); } catch (IOException e) { System.err.println("Recipient online. Failed to send message" + message.getId()); e.printStackTrace(); diff --git a/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java b/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java index 4eec2bc..1453ce3 100644 --- a/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java +++ b/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java @@ -29,8 +29,7 @@ public class MessageStatusChangeProcessor implements ObjectProcessor