From a6b3956014a894ff4e8e1d9194c10869e5911e34 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Fri, 20 Dec 2013 00:48:41 +0700 Subject: Don't send post to it's author --- src/com/juick/server/SubscriptionsQueries.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/com/juick') diff --git a/src/com/juick/server/SubscriptionsQueries.java b/src/com/juick/server/SubscriptionsQueries.java index ca382fc7..20540b93 100644 --- a/src/com/juick/server/SubscriptionsQueries.java +++ b/src/com/juick/server/SubscriptionsQueries.java @@ -49,9 +49,10 @@ public class SubscriptionsQueries { PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = sql.prepareStatement("SELECT DISTINCT jid FROM jids WHERE active=1 AND user_id IN (SELECT suser_id FROM subscr_users WHERE user_id=? UNION SELECT suser_id FROM subscr_tags INNER JOIN messages_tags ON (messages_tags.message_id=? AND subscr_tags.tag_id=messages_tags.tag_id))"); + stmt = sql.prepareStatement("SELECT DISTINCT jid FROM jids WHERE active=1 AND user_id!=? AND user_id IN (SELECT suser_id FROM subscr_users WHERE user_id=? UNION SELECT suser_id FROM subscr_tags INNER JOIN messages_tags ON (messages_tags.message_id=? AND subscr_tags.tag_id=messages_tags.tag_id))"); stmt.setInt(1, uid); - stmt.setInt(2, mid); + stmt.setInt(2, uid); + stmt.setInt(3, mid); rs = stmt.executeQuery(); rs.beforeFirst(); while (rs.next()) { -- cgit v1.2.3