mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
ensure posts are tagged as nsfw inside nsfw communities
This commit is contained in:
parent
e6d81db15f
commit
355d0cd860
1 changed files with 4 additions and 1 deletions
|
@ -1201,7 +1201,10 @@ class Post(db.Model):
|
|||
microblog=microblog,
|
||||
posted_at=utcnow()
|
||||
)
|
||||
|
||||
if community.nsfw:
|
||||
post.nsfw = True # old Lemmy instances ( < 0.19.8 ) allow nsfw content in nsfw communities to be flagged as sfw which makes no sense
|
||||
if community.nsfl:
|
||||
post.nsfl = True
|
||||
if 'content' in request_json['object'] and request_json['object']['content'] is not None:
|
||||
if 'mediaType' in request_json['object'] and request_json['object']['mediaType'] == 'text/html':
|
||||
post.body_html = allowlist_html(request_json['object']['content'])
|
||||
|
|
Loading…
Reference in a new issue