From 03a03639514bfb586555a3367fd3ea58da0f2a94 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 19 Dec 2016 23:39:25 +0300 Subject: juick-server: fix tags in getSubscribedUsers --- .../src/main/java/com/juick/service/SubscriptionServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main/java/com/juick/service') 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 767c62fc..decfe59d 100644 --- a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -58,14 +58,16 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip User author = messagesService.getMessageAuthor(mid); List userids = userService.getUserReaders(uid); + List tags = tagService.getMessageTagsIDs(mid); + List tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); Set set = new HashSet<>(); set.addAll( userids.stream() - .map(User::getUid) + .map(User::getUid).filter(u -> Collections.disjoint(tagService.getUserBLTags(u), tagsStr)) .collect(Collectors.toList())); - List tags = tagService.getMessageTagsIDs(mid); + if (!tags.isEmpty()) { List tagUsers = getNamedParameterJdbcTemplate().queryForList( "SELECT st.suser_id FROM subscr_tags st " + -- cgit v1.2.3