From 1115ff7cacecc75891203c6a82926954820d5475 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 21 Nov 2016 16:51:03 +0300 Subject: juick-server: respect banned tags when getting subscribed users --- .../src/main/java/com/juick/server/SubscriptionsQueries.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'juick-server/src/main') 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 tags = MessagesQueries.getMessageTagsIDs(sql, mid); if (tags.size() > 0) { + String tagsStr = StringUtils.arrayToCommaDelimitedString(tags.toArray()); List 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)); -- cgit v1.2.3