diff options
author | 2018-10-24 00:31:28 +0300 | |
---|---|---|
committer | 2018-10-24 00:34:42 +0300 | |
commit | 5b88a7355c554e500199d6c233ae891459b602ac (patch) | |
tree | cca19bfa8fa75e06debf1b072e979be68035fab7 /juick-server/src/main/java/com/juick/server/ActivityPubManager.java | |
parent | 8e6d764d6bb4391532e5376c795f634ee3898872 (diff) |
Fix deserialisation and tests
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/ActivityPubManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/ActivityPubManager.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java index 4a6ed7be..6cfcf377 100644 --- a/juick-server/src/main/java/com/juick/server/ActivityPubManager.java +++ b/juick-server/src/main/java/com/juick/server/ActivityPubManager.java @@ -214,7 +214,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene attachment.setId(msg.getAttachment().getMedium().getUrl()); attachment.setUrl(msg.getAttachment().getMedium().getUrl()); attachment.setMediaType(HttpUtils.mediaType(msg.getAttachmentType())); - note.setAttachment(attachment); + note.setAttachment(Collections.singletonList(attachment)); } note.setTags(msg.getTags().stream().map(t -> { Hashtag hashtag = new Hashtag(); @@ -222,7 +222,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene hashtag.setName("#" + t.getName()); return hashtag; }).collect(Collectors.toList())); - if (msg.getReplyToUri().toASCIIString().length() > 0) { + if (msg.getReplyToUri() != null && msg.getReplyToUri().toASCIIString().length() > 0) { Optional<Context> createContext = signatureManager.getContext(msg.getReplyToUri()); if (createContext.isPresent()) { Create activity = (Create) createContext.get(); |