mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
got the read posts filering on main, topics, and community pages
This commit is contained in:
parent
ccbc0b4b22
commit
c6fb8fc554
3 changed files with 21 additions and 0 deletions
|
@ -228,6 +228,13 @@ def show_community(community: Community):
|
|||
posts = posts.filter(Post.nsfl == False)
|
||||
if current_user.hide_nsfw == 1:
|
||||
posts = posts.filter(Post.nsfw == False)
|
||||
if current_user.hide_read_posts:
|
||||
cu_rp = current_user.read_post.all()
|
||||
cu_rp_ids = []
|
||||
for p in cu_rp:
|
||||
cu_rp_ids.append(p.id)
|
||||
for p_id in cu_rp_ids:
|
||||
posts = posts.filter(Post.id != p_id)
|
||||
content_filters = user_filters_posts(current_user.id)
|
||||
posts = posts.filter(Post.deleted == False)
|
||||
|
||||
|
|
|
@ -71,6 +71,13 @@ def home_page(sort, view_filter):
|
|||
posts = posts.filter(Post.nsfl == False)
|
||||
if current_user.hide_nsfw == 1:
|
||||
posts = posts.filter(Post.nsfw == False)
|
||||
if current_user.hide_read_posts:
|
||||
cu_rp = current_user.read_post.all()
|
||||
cu_rp_ids = []
|
||||
for p in cu_rp:
|
||||
cu_rp_ids.append(p.id)
|
||||
for p_id in cu_rp_ids:
|
||||
posts = posts.filter(Post.id != p_id)
|
||||
|
||||
domains_ids = blocked_domains(current_user.id)
|
||||
if domains_ids:
|
||||
|
|
|
@ -65,6 +65,13 @@ def show_topic(topic_path):
|
|||
posts = posts.filter(Post.nsfl == False)
|
||||
if current_user.hide_nsfw == 1:
|
||||
posts = posts.filter(Post.nsfw == False)
|
||||
if current_user.hide_read_posts:
|
||||
cu_rp = current_user.read_post.all()
|
||||
cu_rp_ids = []
|
||||
for p in cu_rp:
|
||||
cu_rp_ids.append(p.id)
|
||||
for p_id in cu_rp_ids:
|
||||
posts = posts.filter(Post.id != p_id)
|
||||
posts = posts.filter(Post.deleted == False)
|
||||
content_filters = user_filters_posts(current_user.id)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue