diff options
author | Vitaly Takmazov | 2021-10-23 11:10:19 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-10-23 11:26:43 +0300 |
commit | 8f96d329454c3343d4177364c12c087bf1147a7d (patch) | |
tree | 68d46609ec48f8154ea886cd2a9542ca3c422394 /src/main/java/com/juick/ActivityPubManager.java | |
parent | 6b5d0deb398b0b77c13c16fbf116b4639feef574 (diff) |
Minor code cleanup
Diffstat (limited to 'src/main/java/com/juick/ActivityPubManager.java')
-rw-r--r-- | src/main/java/com/juick/ActivityPubManager.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/juick/ActivityPubManager.java b/src/main/java/com/juick/ActivityPubManager.java index 5df89527..621a89c2 100644 --- a/src/main/java/com/juick/ActivityPubManager.java +++ b/src/main/java/com/juick/ActivityPubManager.java @@ -249,7 +249,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene User user = msg.getUser(); String userUri = personUri(user); Note note = makeNote(msg); - Person me = (Person) signatureManager.getContext(URI.create(userUri)).get(); + Actor me = (Actor) signatureManager.getContext(URI.create(userUri)).get(); Set<String> subscribers = new HashSet<>(socialService.getFollowers(user)); if (MessageUtils.isReply(msg) && msg.getTo().getUri().toASCIIString().length() > 0) { String replier = msg.getTo().getUri().toASCIIString(); @@ -261,7 +261,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene subscribers.addAll(note.getCc()); subscribers.forEach(acct -> { Optional<Context> context = signatureManager.getContext(URI.create(acct)); - if (context.isPresent() && context.get() instanceof Person) { + if (context.isPresent() && context.get() instanceof Actor) { Actor follower = (Actor)context.get(); Create create = new Create(); create.setId(note.getId()); @@ -359,7 +359,7 @@ public class ActivityPubManager implements ActivityListener, NotificationListene Note activity = (Note) noteContext.get(); Optional<Context> personContext = signatureManager.getContext(URI.create(activity.getAttributedTo())); if (personContext.isPresent()) { - Person person = (Person) personContext.get(); + Actor person = (Actor) personContext.get(); note.getTags().add(new Mention(person.getUrl(), person.getPreferredUsername())); msg.getTo().setName(person.getPreferredUsername()); note.setInReplyTo(activity.getInReplyTo()); @@ -424,8 +424,8 @@ public class ActivityPubManager implements ActivityListener, NotificationListene }, () -> logger.warn("Follower not found: {}", acct)); }); } - public User personToUser(URI uri) throws HttpBadRequestException { - Person person = (Person) signatureManager.getContext(uri).orElseThrow(HttpBadRequestException::new); + public User actorToUser(URI uri) throws HttpBadRequestException { + Actor person = (Actor) signatureManager.getContext(uri).orElseThrow(HttpBadRequestException::new); User user = new User(); user.setUri(URI.create(person.getId())); user.setName(person.getPreferredUsername()); |