aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-01 14:00:31 +0300
committerGravatar Vitaly Takmazov2016-07-01 14:00:31 +0300
commit67d53fe24081ade138b5d9756fd835575eb4ae79 (patch)
tree0ffe961fa633095fc1651032218e282116098f60 /src/main
parent53a4aaacf585e70aadd3b1133319a5bb1e08f0c4 (diff)
fix getSubscribedUsers
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/server/SubscriptionsQueries.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/SubscriptionsQueries.java b/src/main/java/com/juick/server/SubscriptionsQueries.java
index 9f0372ff..0cf3f169 100644
--- a/src/main/java/com/juick/server/SubscriptionsQueries.java
+++ b/src/main/java/com/juick/server/SubscriptionsQueries.java
@@ -14,6 +14,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.logging.Logger;
+import java.util.stream.Collectors;
/**
*
@@ -36,9 +37,9 @@ public class SubscriptionsQueries {
}
public static List<User> getSubscribedUsers(JdbcTemplate sql, int uid, int mid) {
- List<Integer> userids = UserQueries.getUserRead(sql, uid);
+ List<User> userids = UserQueries.getUserReaders(sql, uid);
Set<Integer> set = new HashSet<>();
- set.addAll(userids);
+ set.addAll(userids.stream().map(User::getUID).collect(Collectors.toList()));
List<Integer> tags = MessagesQueries.getMessageTagsIDs(sql, mid);
if (tags.size() > 0) {
List<Integer> tagUsers = sql.queryForList("SELECT suser_id FROM subscr_tags " +