From 83ddc0218722a0698e1e2a517662a6a7097c9d11 Mon Sep 17 00:00:00 2001 From: DieGurke <55625494+DieGurke@users.noreply.github.com> Date: Sun, 5 Jul 2020 13:28:48 +0200 Subject: [PATCH] Reimplemented RECEIVED update sending to sender --- .../server/processors/GroupMessageProcessor.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/envoy/server/processors/GroupMessageProcessor.java b/src/main/java/envoy/server/processors/GroupMessageProcessor.java index f62054e..725004e 100644 --- a/src/main/java/envoy/server/processors/GroupMessageProcessor.java +++ b/src/main/java/envoy/server/processors/GroupMessageProcessor.java @@ -8,6 +8,7 @@ import javax.persistence.EntityExistsException; import envoy.data.GroupMessage; import envoy.data.Message.MessageStatus; +import envoy.event.MessageStatusChange; import envoy.server.data.PersistenceManager; import envoy.server.net.ConnectionManager; import envoy.server.net.ObjectWriteProxy; @@ -42,12 +43,12 @@ public class GroupMessageProcessor implements ObjectProcessor { // sender, if he is still online. if (!groupMessage.getMemberStatuses().containsValue(MessageStatus.SENT)) { groupMessage.setStatus(MessageStatus.RECEIVED); -// if (connectionManager.isOnline(connectionManager.getUserIdBySocketID(socketID))) try { -// writeProxy.write(socketID, new MessageStatusChange(groupMessage)); -// } catch (IOException e) { -// logger.warning("Sender of the groupMessage online. Failed to send MessageStatusChange"); -// e.printStackTrace(); -// } + if (connectionManager.isOnline(connectionManager.getUserIdBySocketID(socketID))) try { + writeProxy.write(socketID, new MessageStatusChange(groupMessage)); + } catch (IOException e) { + logger.warning("Sender of the groupMessage online. Failed to send MessageStatusChange"); + e.printStackTrace(); + } } members.stream()