diff options
author | Vitaly Takmazov | 2018-11-20 16:37:42 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-11-20 16:37:42 +0300 |
commit | a3ec3587e1fa33e4e08da9783d9d66c55ac84550 (patch) | |
tree | 9311de2f6511421eefed3e2e10bc821d2179dbd4 /src/main/java/com/juick/server/api/rss | |
parent | d2b04d9b719b79a35e90b1c5569722ba5cbf794b (diff) |
avatar public url
Diffstat (limited to 'src/main/java/com/juick/server/api/rss')
-rw-r--r-- | src/main/java/com/juick/server/api/rss/MessagesView.java | 7 |
1 files changed, 6 insertions, 1 deletions
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); |