diff options
author | Vitaly Takmazov | 2016-11-21 16:51:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-21 16:51:03 +0300 |
commit | 1115ff7cacecc75891203c6a82926954820d5475 (patch) | |
tree | 925217ba0cef13000f4231e84aebbd95c4f54864 /juick-server/src/main/java/com/juick | |
parent | 7a79f80d9bf48c84ee86faf8d09ef4bc05a52fb4 (diff) |
juick-server: respect banned tags when getting subscribed users
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/SubscriptionsQueries.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/SubscriptionsQueries.java b/juick-server/src/main/java/com/juick/server/SubscriptionsQueries.java index 08d704d9..b6cfbbd0 100644 --- a/juick-server/src/main/java/com/juick/server/SubscriptionsQueries.java +++ b/juick-server/src/main/java/com/juick/server/SubscriptionsQueries.java @@ -39,9 +39,11 @@ public class SubscriptionsQueries { set.addAll(userids.stream().map(User::getUid).collect(Collectors.toList())); List<Integer> tags = MessagesQueries.getMessageTagsIDs(sql, mid); if (tags.size() > 0) { + String tagsStr = StringUtils.arrayToCommaDelimitedString(tags.toArray()); List<Integer> tagUsers = sql.queryForList("SELECT suser_id FROM subscr_tags " + - "WHERE tag_id IN (" + StringUtils.arrayToCommaDelimitedString(tags.toArray()) + ") AND suser_id!=? " + - " AND suser_id NOT IN (SELECT user_id FROM bl_users WHERE bl_user_id=?)", Integer.class, uid, author.getUid()); + "WHERE tag_id IN (" + tagsStr + ") AND suser_id!=? " + + " AND suser_id NOT IN (SELECT user_id FROM bl_users WHERE bl_user_id=?)" + + " AND suser_id NOT IN (SELECT user_id FROM bl_tags WHERE tag_id IN (" + tagsStr + "))", Integer.class, uid, author.getUid()); set.addAll(tagUsers); } return UserQueries.getUsersByID(sql, new ArrayList<>(set)); |