aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/service')
-rw-r--r--juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java6
1 files changed, 4 insertions, 2 deletions
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 767c62fca..decfe59d5 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<User> userids = userService.getUserReaders(uid);
+ List<Integer> tags = tagService.getMessageTagsIDs(mid);
+ List<String> tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList());
Set<Integer> 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<Integer> tags = tagService.getMessageTagsIDs(mid);
+
if (!tags.isEmpty()) {
List<Integer> tagUsers = getNamedParameterJdbcTemplate().queryForList(
"SELECT st.suser_id FROM subscr_tags st " +