diff options
Diffstat (limited to 'src/main/java/com/juick/www/rss/MessagesView.java')
-rw-r--r-- | src/main/java/com/juick/www/rss/MessagesView.java | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/main/java/com/juick/www/rss/MessagesView.java b/src/main/java/com/juick/www/rss/MessagesView.java index 6355c47d..2c7d4a7d 100644 --- a/src/main/java/com/juick/www/rss/MessagesView.java +++ b/src/main/java/com/juick/www/rss/MessagesView.java @@ -17,14 +17,29 @@ package com.juick.www.rss; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import javax.annotation.Nonnull; +import javax.annotation.PostConstruct; +import javax.inject.Inject; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + import com.juick.model.Attachment; import com.juick.model.Message; import com.juick.model.User; -import com.juick.service.ImagesService; +import com.juick.service.StorageService; +import com.juick.util.MessageUtils; +import com.juick.www.WebApp; import com.juick.www.rss.extension.JuickModule; import com.juick.www.rss.extension.JuickModuleImpl; -import com.juick.www.WebApp; -import com.juick.util.MessageUtils; import com.rometools.modules.atom.modules.AtomLinkModule; import com.rometools.modules.atom.modules.AtomLinkModuleImpl; import com.rometools.modules.mediarss.MediaEntryModuleImpl; @@ -47,21 +62,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - /** * Created by vitalyster on 13.12.2016. */ @@ -70,9 +70,9 @@ public class MessagesView extends AbstractRssFeedView { private static final Logger logger = LoggerFactory.getLogger(Feeds.class); @Inject - private WebApp webApp; + private StorageService storageService; @Inject - private ImagesService imagesService; + private WebApp webApp; @PostConstruct public void init() { @@ -99,12 +99,11 @@ public class MessagesView extends AbstractRssFeedView { String link = String.format("https://juick.com/%s/", user.getName()); feed.setLink(link); try { + Attachment avatar = storageService.getAvatarMetadata(user); Image rssImage = new Image(); rssImage.setUrl(webApp.getAvatarUrl(user)); rssImage.setTitle(title); rssImage.setLink(link); - Attachment avatar; - avatar = imagesService.getImageMetadata(rssImage.getUrl()); rssImage.setHeight(avatar.getHeight()); rssImage.setWidth(avatar.getWidth()); feed.setImage(rssImage); |