aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api/activity
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/api/activity')
-rw-r--r--src/main/java/com/juick/server/api/activity/Profile.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/api/activity/Profile.java b/src/main/java/com/juick/server/api/activity/Profile.java
index f4160eab..60e099d0 100644
--- a/src/main/java/com/juick/server/api/activity/Profile.java
+++ b/src/main/java/com/juick/server/api/activity/Profile.java
@@ -24,6 +24,7 @@ import com.juick.server.api.activity.model.objects.Person;
import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpNotFoundException;
import com.juick.server.util.UserUtils;
+import com.juick.server.www.WebApp;
import com.juick.service.MessagesService;
import com.juick.service.UserService;
import com.juick.service.activities.DeleteUserEvent;
@@ -81,6 +82,8 @@ public class Profile {
private String baseImagesUri;
@Inject
private ObjectMapper jsonMapper;
+ @Inject
+ private WebApp webApp;
@GetMapping(value = "/u/{userName}", produces = {Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE})
public Person getUser(@PathVariable String userName) {
@@ -101,7 +104,7 @@ public class Profile {
person.setFollowers(activityPubManager.followersUri(user));
person.setFollowing(activityPubManager.followingUri(user));
UriComponentsBuilder image = UriComponentsBuilder.fromUriString(baseImagesUri);
- image.path(String.format("/a/%d.png", user.getUid()));
+ image.path(webApp.getAvatarPublicUrl(user));
Image avatar = new Image();
avatar.setUrl(image.toUriString());
avatar.setMediaType("image/png");