aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick')
-rw-r--r--juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java12
1 files changed, 5 insertions, 7 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 f6ecb658..7e6b9d0a 100644
--- a/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/SubscriptionServiceImpl.java
@@ -64,13 +64,11 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip
set.addAll(userids.stream().map(User::getUid).collect(Collectors.toList()));
List<Integer> tags = messagesService.getMessageTagsIDs(mid);
if (tags.size() > 0) {
- List<Integer> tagUsers = getJdbcTemplate().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());
+ String tagsStr = StringUtils.arrayToCommaDelimitedString(tags.toArray());
+ List<Integer> tagUsers = getJdbcTemplate().queryForList("SELECT suser_id FROM subscr_tags " +
+ "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 userService.getUsersByID(new ArrayList<>(set));