diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server')
-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 08d704d90..b6cfbbd0d 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)); |