From a3ec3587e1fa33e4e08da9783d9d66c55ac84550 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 20 Nov 2018 16:37:42 +0300 Subject: avatar public url --- src/main/java/com/juick/server/api/rss/MessagesView.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/server/api/rss') diff --git a/src/main/java/com/juick/server/api/rss/MessagesView.java b/src/main/java/com/juick/server/api/rss/MessagesView.java index c0ae4a97..4b29108e 100644 --- a/src/main/java/com/juick/server/api/rss/MessagesView.java +++ b/src/main/java/com/juick/server/api/rss/MessagesView.java @@ -21,6 +21,7 @@ import com.juick.Message; import com.juick.User; import com.juick.server.api.rss.extension.JuickModule; import com.juick.server.api.rss.extension.JuickModuleImpl; +import com.juick.server.www.WebApp; import com.juick.util.MessageUtils; import com.rometools.modules.atom.modules.AtomLinkModule; import com.rometools.modules.atom.modules.AtomLinkModuleImpl; @@ -40,6 +41,7 @@ import org.springframework.web.servlet.view.feed.AbstractRssFeedView; import javax.annotation.Nonnull; import javax.annotation.PostConstruct; +import javax.inject.Inject; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.net.URI; @@ -57,6 +59,9 @@ public class MessagesView extends AbstractRssFeedView { private static final Logger logger = LoggerFactory.getLogger(MessagesView.class); + @Inject + private WebApp webApp; + @PostConstruct public void init() { setContentType("application/rss+xml;charset=UTF-8"); @@ -82,7 +87,7 @@ public class MessagesView extends AbstractRssFeedView { String link = String.format("http://juick.com/%s/", user.getName()); feed.setLink(link); Image rssImage = new Image(); - rssImage.setUrl(String.format("http://juick.com/a/%d.png", user.getUid())); + rssImage.setUrl(webApp.getAvatarPublicUrl(user)); rssImage.setTitle(title); rssImage.setLink(link); feed.setImage(rssImage); -- cgit v1.2.3