aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/api/activity
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-20 16:37:42 +0300
committerGravatar Vitaly Takmazov2018-11-20 16:37:42 +0300
commita3ec3587e1fa33e4e08da9783d9d66c55ac84550 (patch)
tree9311de2f6511421eefed3e2e10bc821d2179dbd4 /src/main/java/com/juick/server/api/activity
parentd2b04d9b719b79a35e90b1c5569722ba5cbf794b (diff)
avatar public url
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");