Fixed error regarding notSerializable exception

This commit is contained in:
DieGurke 2020-06-28 10:33:06 +02:00
parent cea599ac2f
commit acf58941ac
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package envoy.server.data;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.Column;
@ -73,7 +74,7 @@ public class GroupMessage extends Message {
.setForwarded(forwarded)
.setStatus(status)
.setText(text)
.buildGroupMessage((envoy.data.Group) recipient.toCommon(), memberMessageStatus);
.buildGroupMessage((envoy.data.Group) recipient.toCommon(), new HashMap<>(memberMessageStatus));
groupMessage.setReceivedDate(receivedDate);
groupMessage.setReadDate(readDate);
return groupMessage;

View File

@ -145,9 +145,10 @@ public final class LoginCredentialProcessor implements ObjectProcessor<LoginCred
for (GroupMessage gmsg : pendingGroupMessages) {
if (gmsg.getMemberMessageStatus().get(user.getID()) == MessageStatus.SENT) {
gmsg.getMemberMessageStatus().replace(user.getID(), MessageStatus.RECEIVED);
logger.info("Sending groupMessage" + gmsg.toCommon());
System.out.println(gmsg.toCommon().toString());
writeProxy.write(socketID, gmsg.toCommon());
envoy.data.GroupMessage groupMessage = gmsg.toCommon();
logger.info("Sending groupMessage" + groupMessage);
System.out.println(groupMessage.toString());
writeProxy.write(socketID, groupMessage);
// Sending memberStatusEvent to all members (event does not exist yet I think)
if (!gmsg.getMemberMessageStatus().containsValue(MessageStatus.SENT)) {
gmsg.setStatus(MessageStatus.RECEIVED);