Fixed issue regarding the sender of a message not getting an MSCEvent

Added messageStatusChangeEvent sending to online sender if recipient
logs in and sender is online at the same time
This commit is contained in:
DieGurke 2020-06-10 23:23:35 +02:00 committed by CyB3RC0nN0R
parent 693ef0875d
commit 135e9b7f76

View File

@ -62,6 +62,11 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
writeProxy.write(socketID, msg.toCommon());
msg.setReceivedDate(new Date());
msg.setStatus(MessageStatus.RECEIVED);
if (connectionManager.isOnline(msg.getSender().getID())) {
var evt = new MessageStatusChangeEvent(msg.toCommon());
System.out.println("Sending messageStatusChangeEvent to sender " + evt);
writeProxy.write(connectionManager.getSocketId(msg.getSender().getID()), evt);
}
PersistenceManager.getInstance().updateMessage(msg);
} else {
var evt = new MessageStatusChangeEvent(msg.toCommon());