diff --git a/notifier/database/queries/get_posts_in_subscribed_threads.sql b/notifier/database/queries/get_posts_in_subscribed_threads.sql index f18dd754..9379afc7 100644 --- a/notifier/database/queries/get_posts_in_subscribed_threads.sql +++ b/notifier/database/queries/get_posts_in_subscribed_threads.sql @@ -31,11 +31,6 @@ FROM AND thread_sub.thread_id = thread.id AND thread_sub.post_id IS NULL ) - LEFT JOIN - post AS user_response_child_post ON ( - user_response_child_post.parent_post_id = post.id - AND user_response_child_post.user_id = %(user_id)s - ) WHERE -- Remove deleted posts post.is_deleted = 0 @@ -59,9 +54,6 @@ WHERE -- Remove posts in threads unsubscribed from AND (thread_sub.sub <> -1 OR thread_sub.sub IS NULL) - - -- Remove posts the user already responded to - AND user_response_child_post.id IS NULL ORDER BY wiki.id, category.id, diff --git a/notifier/database/queries/get_replies_to_subscribed_posts.sql b/notifier/database/queries/get_replies_to_subscribed_posts.sql index f33eed20..21e0eb1a 100644 --- a/notifier/database/queries/get_replies_to_subscribed_posts.sql +++ b/notifier/database/queries/get_replies_to_subscribed_posts.sql @@ -33,11 +33,6 @@ FROM AND post_sub.thread_id = thread.id AND post_sub.post_id = parent_post.id ) - LEFT JOIN - post AS user_response_child_post ON ( - user_response_child_post.parent_post_id = post.id - AND user_response_child_post.user_id = %(user_id)s - ) WHERE -- Remove deleted posts post.is_deleted = 0 @@ -60,10 +55,8 @@ WHERE ) -- Remove replies to posts unsubscribed from + -- Sub table is added to this query via left join, so the null check matches when the user has no manual subscription to or from a post AND (post_sub.sub <> -1 OR post_sub.sub IS NULL) - - -- Remove posts the user already responded to - AND user_response_child_post.id IS NULL ORDER BY wiki.id, category.id,