Sending unread message as common messages instead of database messages

This commit is contained in:
Kai S. K. Engelbart 2020-02-03 07:06:52 +01:00
parent af865b77ad
commit 6a5680a19f

View File

@ -66,8 +66,8 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
System.out.println("Acquiring pending messages for the client...");
List<Message> pendingMessages = PersistenceManager.getPersistenceManager().getUnreadMessages(user);
for (Message msg : pendingMessages) {
System.out.println("Sending message " + msg.toString());
writeProxy.write(socketId, msg);
System.out.println("Sending message " + msg.toCommonMessage().toString());
writeProxy.write(socketId, msg.toCommonMessage());
msg.setReceivedDate(new Date());
msg.setStatus(MessageStatus.RECEIVED);
PersistenceManager.getPersistenceManager().updateMessage(msg);