From 5518faa7d7c28ae2a996fe057e7747d3b307c749 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 15 Aug 2018 15:05:42 +0300 Subject: Recommendation subscribers should not contain message author --- .../src/main/java/com/juick/service/SubscriptionServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'juick-server/src/main/java/com') diff --git a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java index e8c32e77..1dee379f 100644 --- a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -113,12 +113,12 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip } @Override - public List getUsersSubscribedToUserRecommendations(final int uid, final int mid, final int muid) { - Message msg = messagesService.getMessage(mid); - List msgTags = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); + public List getUsersSubscribedToUserRecommendations(final int uid, final Message msg) { + List msgTags = tagService.getMessageTags(msg.getMid()).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); if (msg.getLikes() == 1) { return userService.getUserReaders(uid).stream() - .filter(u -> !userService.isInBLAny(u.getUid(), muid)) + .filter(u -> !u.equals(msg.getUser())) + .filter(u -> !userService.isInBLAny(u.getUid(), msg.getUser().getUid())) .filter(u -> Collections.disjoint(tagService.getUserBLTags(u.getUid()), msgTags)) .collect(Collectors.toList()); } -- cgit v1.2.3