aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-12 12:10:44 +0300
committerGravatar Vitaly Takmazov2018-11-12 12:10:49 +0300
commitf7eeb5c5d40648bf1e0f76dab4e68c96995872c7 (patch)
tree79942d5fad59ca791e929b51eeb680dc55700165 /src/main/java/com/juick/service
parentd158b85517189afd43532a752e0093394c135f0f (diff)
api: message entities
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java5
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;
}