diff options
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r-- | src/main/java/com/juick/service/MessagesServiceImpl.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index 0b7faf87..efe480c0 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -368,6 +368,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ final Message message = list.get(0); Map<Integer, Set<Reaction>> reactionStats = updateReactionsFor(Collections.singletonList(mid)); message.setReactions(reactionStats.get(message.getMid())); + message.setEntities(MessageUtils.getEntities(message)); return message; } return null; @@ -429,6 +430,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ logger.warn("exception reading images for mid {} rid {}", msg.getMid(), msg.getRid(), e); } } + msg.setEntities(MessageUtils.getEntities(msg)); return msg; }, mid, rid); @@ -882,6 +884,8 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ msgs.sort(Comparator.comparing(item -> mids.indexOf(item.getMid()))); + msgs.forEach(i -> i.setEntities(MessageUtils.getEntities(i))); + return msgs; } return Collections.emptyList(); @@ -957,6 +961,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ if (replies.size() > 0) { setRead(user, mid); } + replies.forEach(i -> i.setEntities(MessageUtils.getEntities(i))); return replies; } |