From 570a93683c846ecf85fff2ed650e895be81fa59e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 1 Mar 2019 23:21:14 +0300 Subject: Avatars for quote user --- src/main/java/com/juick/service/MessagesServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main') diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index 33c9cee1..7dbfe1dd 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -24,6 +24,7 @@ import com.juick.model.AnonymousUser; import com.juick.model.PrivacyOpts; import com.juick.model.ResponseReply; import com.juick.server.util.HttpNotFoundException; +import com.juick.server.www.WebApp; import com.juick.util.MessageUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -74,6 +75,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ private SearchService searchService; @Inject private ImagesService imagesService; + @Inject + private WebApp webApp; @Value("${photos_url:https://i.juick.com/}") private String baseImagesUrl; @@ -111,6 +114,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ if (quoteUid == 0) { quoteUser.setName(AnonymousUser.INSTANCE.getName()); quoteUser.setUri(URI.create(Optional.ofNullable(rs.getString(23)).orElse(StringUtils.EMPTY))); + } else { + quoteUser.setAvatar(webApp.getAvatarUrl(quoteUser)); } msg.setTo(quoteUser); msg.setUpdatedAt(rs.getTimestamp(21).toInstant()); -- cgit v1.2.3