aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/Profile.java6
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Note.java9
2 files changed, 15 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
index 772b1beeb..4160275d6 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java
@@ -6,6 +6,7 @@ import com.juick.server.util.HttpNotFoundException;
import com.juick.server.util.UserUtils;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -85,6 +86,11 @@ public class Profile {
Note note = new Note();
note.setPublished(m.getTimestamp());
note.setContent(m.getText());
+ if (StringUtils.isNotBlank(m.getAttachmentType())) {
+ Link attachment = new Link();
+ attachment.setHref(m.getAttachment().getMedium().getUrl());
+ note.setAttachment(attachment);
+ }
return note;
}).collect(Collectors.toList());
Person person = new Person();
diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java
index 0716779a2..ae799f5ec 100644
--- a/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java
+++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Note.java
@@ -3,6 +3,7 @@ package com.juick.server.api.activity.model;
public class Note extends ActivityObject {
private String content;
private String attributedTo;
+ private Link attachment;
public String getContent() {
return content;
@@ -19,4 +20,12 @@ public class Note extends ActivityObject {
public void setAttributedTo(String attributedTo) {
this.attributedTo = attributedTo;
}
+
+ public Link getAttachment() {
+ return attachment;
+ }
+
+ public void setAttachment(Link attachment) {
+ this.attachment = attachment;
+ }
}