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.java3
-rw-r--r--juick-server/src/main/java/com/juick/server/api/activity/model/Person.java9
2 files changed, 12 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 4f81c4fb..b7098355 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
@@ -48,6 +48,7 @@ public class Profile {
person.setId(uri.toUriString());
person.setUrl(uri.toUriString());
person.setName(userName);
+ person.setPreferredUsername(userName);
Key publicKey = new Key();
publicKey.setId(person.getId() + "#main-key");
publicKey.setOwner(person.getId());
@@ -160,6 +161,7 @@ public class Profile {
result.setOrderedItems(followersPage.map(a -> {
Person follower = new Person();
follower.setName(a.getName());
+ person.setPreferredUsername(a.getName());
follower.setUrl(uriComponentsBuilder.replacePath(String.format("/u/%s", a.getName())).toUriString());
return follower;
}).collect(Collectors.toList()));
@@ -196,6 +198,7 @@ public class Profile {
Person person = new Person();
person.setName(user.getName());
+ person.setPreferredUsername(user.getName());
OrderedCollectionPage result = new OrderedCollectionPage();
result.setId(ServletUriComponentsBuilder.fromCurrentRequestUri().toUriString());
result.setOrderedItems(followingPage.map(a -> {
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 b7bc6547..e314624d 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,6 +3,7 @@ package com.juick.server.api.activity.model;
public class Person extends ActivityObject {
private String name;
+ private String preferredUsername;
private Image icon;
private String inbox;
private String outbox;
@@ -79,4 +80,12 @@ public class Person extends ActivityObject {
public void setPublicKey(Key publicKey) {
this.publicKey = publicKey;
}
+
+ public String getPreferredUsername() {
+ return preferredUsername;
+ }
+
+ public void setPreferredUsername(String preferredUsername) {
+ this.preferredUsername = preferredUsername;
+ }
}