aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index 8292f4fd..6874c7bc 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -92,10 +92,6 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
msg.setReplies(rs.getInt(10));
msg.setAttachmentType(rs.getString(11));
msg.Hidden = rs.getBoolean(13);
- if (msg.getRid() == 0) {
- msg.setTags(tagService.getMessageTags(msg.getMid()).stream()
- .map(TagStats::getTag).collect(Collectors.toSet()));
- }
msg.setRepliesBy(rs.getString(15));
msg.setText(rs.getString(16));
msg.setReplyQuote(MessageUtils.formatQuote(rs.getString(17)));
@@ -822,6 +818,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
List<Message> msgs = getNamedParameterJdbcTemplate().query(query,
new MapSqlParameterSource("ids", mids)
.addValue("uid", uid), messageMapper);
+
+ msgs.forEach(m -> m.setTags(tagService.getMessageTags(m.getMid()).stream()
+ .map(TagStats::getTag).collect(Collectors.toSet())));
Map<Integer, Set<Reaction>> likes = updateReactionsFor(mids);
msgs.forEach(i -> i.setReactions(likes.get(i.getMid())));
msgs.sort(Comparator.comparing(item -> mids.indexOf(item.getMid())));