From 67d53fe24081ade138b5d9756fd835575eb4ae79 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 1 Jul 2016 14:00:31 +0300 Subject: fix getSubscribedUsers --- src/main/java/com/juick/server/SubscriptionsQueries.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 getSubscribedUsers(JdbcTemplate sql, int uid, int mid) { - List userids = UserQueries.getUserRead(sql, uid); + List userids = UserQueries.getUserReaders(sql, uid); Set set = new HashSet<>(); - set.addAll(userids); + set.addAll(userids.stream().map(User::getUID).collect(Collectors.toList())); List tags = MessagesQueries.getMessageTagsIDs(sql, mid); if (tags.size() > 0) { List tagUsers = sql.queryForList("SELECT suser_id FROM subscr_tags " + -- cgit v1.2.3