From 58d8dd35de41d3e567a2d00765784e2bab39ddcd Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 5 Sep 2018 10:32:34 +0300 Subject: ActivityStreams: Person icon is Image --- .../com/juick/server/api/activity/Profile.java | 5 +++-- .../com/juick/server/api/activity/model/Image.java | 22 ++++++++++++++++++++++ .../juick/server/api/activity/model/Person.java | 6 +++--- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 juick-server/src/main/java/com/juick/server/api/activity/model/Image.java (limited to 'juick-server/src/main') 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 19b1271b..4a44db3b 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 @@ -47,8 +47,9 @@ public class Profile { person.setOutbox(outboxBuilder.path(String.format("/u/%s/blog", userName)).toUriString()); UriComponentsBuilder imgBuilder = UriComponentsBuilder.fromUriString(baseImagesUri); imgBuilder.path(String.format("/a/%d.png", user.getUid())); - Link avatar = new Link(); - avatar.setHref(imgBuilder.toUriString()); + Image avatar = new Image(); + avatar.setUrl(imgBuilder.toUriString()); + avatar.setMediaType("image/png"); person.setIcon(avatar); return person; } diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Image.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Image.java new file mode 100644 index 00000000..9a3b1659 --- /dev/null +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Image.java @@ -0,0 +1,22 @@ +package com.juick.server.api.activity.model; + +public class Image extends ActivityObject { + private String mediaType; + private String url; + + public String getMediaType() { + return mediaType; + } + + public void setMediaType(String mediaType) { + this.mediaType = mediaType; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } +} diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java index 626ac309..d3e99bcc 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Person.java @@ -3,7 +3,7 @@ package com.juick.server.api.activity.model; public class Person extends ActivityObject { private String name; - private Link icon; + private Image icon; private String inbox; private String outbox; @@ -20,11 +20,11 @@ public class Person extends ActivityObject { this.name = name; } - public Link getIcon() { + public Image getIcon() { return icon; } - public void setIcon(Link icon) { + public void setIcon(Image icon) { this.icon = icon; } -- cgit v1.2.3