From ab789927eb7fe6aca5c0353a8105dd29c05da548 Mon Sep 17 00:00:00 2001
From: DieGurke <55625494+DieGurke@users.noreply.github.com>
Date: Tue, 28 Apr 2020 20:08:33 +0200
Subject: [PATCH] Changed unimportant stuff
---
.../java/envoy/server/data/GroupMessage.java | 23 ++++++++++++++++++-
src/main/java/envoy/server/data/Message.java | 1 +
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/main/java/envoy/server/data/GroupMessage.java b/src/main/java/envoy/server/data/GroupMessage.java
index f952621..19233d1 100644
--- a/src/main/java/envoy/server/data/GroupMessage.java
+++ b/src/main/java/envoy/server/data/GroupMessage.java
@@ -5,6 +5,8 @@ import java.util.Map;
import javax.persistence.*;
+import envoy.data.MessageBuilder;
+
/**
* Project: envoy-server-standalone
* File: GroupMessage.java
@@ -74,7 +76,26 @@ public class GroupMessage {
// YET
}
- // TODO Implement GroupMessageBuilder and add toCommonGroupMessage method here
+ /**
+ * Converts this groupMessage into an instance of
+ * {@link envoy.data.GroupMessage}.
+ *
+ * @return a {@link envoy.data.GroupMessage} containing the same values as this
+ * groupMessage
+ * @since Envoy Server Standalone v0.1-beta
+ */
+ public envoy.data.GroupMessage toCommonGroupMessage() {
+ // TODO: Attachment
+ envoy.data.GroupMessage groupMessage = new MessageBuilder(sender.getID(), group.getID(), id).setDate(creationDate)
+ .setForwarded(forwarded)
+ .setStatus(status)
+ .setText(text)
+ // .setAttachment(attachment) TODO make this work
+ .buildGroupMessage(group.toCommon(), memberMessageStatus);
+ groupMessage.setReceivedDate(receivedDate);
+ groupMessage.setReadDate(readDate);
+ return groupMessage;
+ }
/**
* @return the id
diff --git a/src/main/java/envoy/server/data/Message.java b/src/main/java/envoy/server/data/Message.java
index 470f772..a21e6b4 100755
--- a/src/main/java/envoy/server/data/Message.java
+++ b/src/main/java/envoy/server/data/Message.java
@@ -105,6 +105,7 @@ public class Message {
.setDate(creationDate)
.setStatus(status)
.setForwarded(forwarded)
+ // .setAttachment(attachment) TODO make this work
.build();
message.setReceivedDate(receivedDate);
message.setReadDate(readDate);