aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-17 22:39:28 +0300
committerGravatar Vitaly Takmazov2018-05-17 22:39:28 +0300
commit235bb5b9fc7072531f19cc25c3b07258198d86ec (patch)
tree127e6c113fe04978ff3c43bee9d6da2fa9e1c6d5 /juick-server-jdbc/src/main/java/com/juick/service
parentc3f5d83b7beed8a523b8a851df742ef028de5efd (diff)
ImagesService refactoring
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
index 6c12583c..612431bf 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -56,8 +56,6 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
private SearchService searchService;
@Inject
private ImagesService imagesService;
- @Value("${img_path:#{systemEnvironment['TEMP'] ?: '/tmp'}}")
- private String imgDir;
@Value("${img_url:https://i.juick.com/}")
private String baseImagesUrl;
@@ -94,10 +92,12 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
quoteUser.setName(rs.getString(20));
msg.setTo(quoteUser);
}
- try {
- imagesService.setAttachmentMetadata(imgDir, baseImagesUrl, msg);
- } catch (Exception e) {
- logger.warn("exception reading images for mid {} rid {}", msg.getMid(), msg.getRid(), e);
+ if (StringUtils.isNotEmpty(msg.getAttachmentType())) {
+ try {
+ imagesService.setAttachmentMetadata(baseImagesUrl, msg);
+ } catch (Exception e) {
+ logger.warn("exception reading images for mid {} rid {}", msg.getMid(), msg.getRid(), e);
+ }
}
return msg;
}