Sending unread message as common messages instead of database messages
This commit is contained in:
parent
79d11f4fba
commit
f11ed4a585
@ -66,8 +66,8 @@ public class LoginCredentialProcessor implements ObjectProcessor<LoginCredential
|
|||||||
System.out.println("Acquiring pending messages for the client...");
|
System.out.println("Acquiring pending messages for the client...");
|
||||||
List<Message> pendingMessages = PersistenceManager.getPersistenceManager().getUnreadMessages(user);
|
List<Message> pendingMessages = PersistenceManager.getPersistenceManager().getUnreadMessages(user);
|
||||||
for (Message msg : pendingMessages) {
|
for (Message msg : pendingMessages) {
|
||||||
System.out.println("Sending message " + msg.toString());
|
System.out.println("Sending message " + msg.toCommonMessage().toString());
|
||||||
writeProxy.write(socketId, msg);
|
writeProxy.write(socketId, msg.toCommonMessage());
|
||||||
msg.setReceivedDate(new Date());
|
msg.setReceivedDate(new Date());
|
||||||
msg.setStatus(MessageStatus.RECEIVED);
|
msg.setStatus(MessageStatus.RECEIVED);
|
||||||
PersistenceManager.getPersistenceManager().updateMessage(msg);
|
PersistenceManager.getPersistenceManager().updateMessage(msg);
|
||||||
|
Reference in New Issue
Block a user