diff options
Diffstat (limited to 'juick-server-jdbc')
-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; } |