diff options
author | Vitaly Takmazov | 2018-05-17 22:39:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-05-17 22:39:28 +0300 |
commit | 235bb5b9fc7072531f19cc25c3b07258198d86ec (patch) | |
tree | 127e6c113fe04978ff3c43bee9d6da2fa9e1c6d5 /juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java | |
parent | c3f5d83b7beed8a523b8a851df742ef028de5efd (diff) |
ImagesService refactoring
Diffstat (limited to 'juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java | 12 |
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; } |