···201201 let viewer_data = self.get_post_viewer_states(&post_uris).await;
202202 let embeds = self.hydrate_embeds(post_uris).await;
203203204204+ // we shouldn't show the parent when the post violates a threadgate.
204205 let reply_refs = posts
205206 .values()
207207+ .filter(|(post, _)| !post.violates_threadgate)
206208 .flat_map(|(post, _)| [post.parent_uri.clone(), post.root_uri.clone()])
207209 .flatten()
208210 .collect::<Vec<_>>();
+2-2
parakeet/src/sql/thread.sql
···11with recursive thread as (select at_uri, parent_uri, root_uri, 0 as depth
22 from posts
33- where parent_uri = $1
33+ where parent_uri = $1 and violates_threadgate=FALSE
44 union all
55 select p.at_uri, p.parent_uri, p.root_uri, thread.depth + 1
66 from posts p
77 join thread on p.parent_uri = thread.at_uri
88- where thread.depth <= $2)
88+ where thread.depth <= $2 and p.violates_threadgate=FALSE)
99select *
1010from thread
1111order by depth desc;
+4-2
parakeet/src/sql/thread_parent.sql
···11with recursive parents as (select at_uri, cid, parent_uri, root_uri, 0 as depth
22 from posts
33- where at_uri = (select parent_uri from posts where at_uri = $1)
33+ where
44+ at_uri = (select parent_uri from posts where at_uri = $1 and violates_threadgate = FALSE)
45 union all
56 select p.at_uri, p.cid, p.parent_uri, p.root_uri, parents.depth + 1
67 from posts p
78 join parents on p.at_uri = parents.parent_uri
88- where parents.depth <= $2)
99+ where parents.depth <= $2
1010+ and p.violates_threadgate = FALSE)
911select *
1012from parents
1113order by depth desc;