aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/XMPPConnection.java
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/XMPPConnection.java
parentd2b04d9b719b79a35e90b1c5569722ba5cbf794b (diff)
avatar public url
Diffstat (limited to 'src/main/java/com/juick/server/XMPPConnection.java')
-rw-r--r--src/main/java/com/juick/server/XMPPConnection.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/XMPPConnection.java b/src/main/java/com/juick/server/XMPPConnection.java
index 0adc7796..74e281c9 100644
--- a/src/main/java/com/juick/server/XMPPConnection.java
+++ b/src/main/java/com/juick/server/XMPPConnection.java
@@ -19,6 +19,7 @@ package com.juick.server;
import com.juick.User;
import com.juick.formatters.PlainTextFormatter;
+import com.juick.server.www.WebApp;
import com.juick.service.component.*;
import com.juick.model.CommandResult;
import com.juick.model.UserInfo;
@@ -118,6 +119,8 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
private ApplicationEventPublisher applicationEventPublisher;
@Value("${service_user:juick}")
private String serviceUsername;
+ @Inject
+ private WebApp webApp;
private User serviceUser;
@@ -170,11 +173,11 @@ public class XMPPConnection implements StanzaListener, NotificationListener {
userVCard.setFormattedName(info.getFullName());
userVCard.setNickname(user.getName());
try {
- userVCard.setPhoto(new VCard.Image(new URI("http://i.juick.com/a/" + user.getUid() + ".png")));
+ userVCard.setPhoto(new VCard.Image(URI.create(webApp.getAvatarPublicUrl(user))));
if (info.getUrl() != null) {
userVCard.setUrl(new URL(info.getUrl()));
}
- } catch (MalformedURLException | URISyntaxException e) {
+ } catch (MalformedURLException e) {
logger.warn("url exception", e);
}
return iq.createResult(userVCard);