From 5d6092caa30a3b03b22deb98f018ac7e742609f1 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 5 Sep 2018 19:04:19 +0300 Subject: ActivityStreams: Activity actor is URL --- .../src/main/java/com/juick/server/api/activity/Profile.java | 6 +++--- .../src/main/java/com/juick/server/api/activity/model/Create.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'juick-server/src/main/java/com/juick/server/api') 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 1b606948..80b8d6da 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 @@ -82,13 +82,13 @@ public class Profile { User user = userService.getUserByName(userName); if (!user.isAnonymous()) { UriComponentsBuilder uri = UriComponentsBuilder.fromUriString(baseUri); - String blogUri = uri.path(String.format("/u/%s/blog/toc", userName)).toUriString(); + String personUri = uri.path(String.format("/u/%s", userName)).toUriString(); String followersUri = uri.replacePath(String.format("/u/%s/followers/toc", userName)).toUriString(); List mids = messagesService.getUserBlog(user.getUid(), 0, before); List notes = messagesService.getMessages(visitor, mids).stream().map(m -> { Note note = new Note(); note.setId(uri.replacePath(String.format("/m/%d", m.getMid())).toUriString()); - note.setAttributedTo(blogUri); + note.setAttributedTo(personUri); note.setTo(Arrays.asList(followersUri, "https://www.w3.org/ns/activitystreams#Public")); note.setPublished(m.getTimestamp()); @@ -109,7 +109,7 @@ public class Profile { Create create = new Create(); create.setId(a.getId() + "#Create"); create.setTo(a.getTo()); - create.setActor(person); + create.setActor(personUri); create.setObject(a); create.setPublished(a.getPublished()); return create; diff --git a/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java index 60ad4ae3..2acdd6a6 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/model/Create.java @@ -4,15 +4,15 @@ import java.util.List; public class Create extends ActivityObject { - private Person actor; + private String actor; private Note object; private List to; - public Person getActor() { + public String getActor() { return actor; } - public void setActor(Person actor) { + public void setActor(String actor) { this.actor = actor; } -- cgit v1.2.3