aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/rss
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-10-23 08:09:05 +0300
committerGravatar Vitaly Takmazov2021-10-23 08:10:06 +0300
commit4b96a9b2e71b7a67effdd55b26ca532ff849d0ef (patch)
tree597a9b268622a10b440f3b119c529e624b8fdb62 /src/main/java/com/juick/www/rss
parent6b31c254b5a7ab6735c625459ba7936d9b2851e6 (diff)
ImagesService -> StorageService
img_path -> storage_path property
Diffstat (limited to 'src/main/java/com/juick/www/rss')
-rw-r--r--src/main/java/com/juick/www/rss/MessagesView.java43
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);