mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
strip post title - activitypub
This commit is contained in:
parent
fd9d744111
commit
c9883c07c0
1 changed files with 3 additions and 3 deletions
|
@ -1619,7 +1619,7 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
title = request_json['object']['name']
|
title = request_json['object']['name'].strip()
|
||||||
|
|
||||||
nsfl_in_title = '[NSFL]' in title.upper() or '(NSFL)' in title.upper()
|
nsfl_in_title = '[NSFL]' in title.upper() or '(NSFL)' in title.upper()
|
||||||
post = Post(user_id=user.id, community_id=community.id,
|
post = Post(user_id=user.id, community_id=community.id,
|
||||||
|
@ -1658,9 +1658,9 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json
|
||||||
if microblog:
|
if microblog:
|
||||||
autogenerated_title = microblog_content_to_title(post.body_html)
|
autogenerated_title = microblog_content_to_title(post.body_html)
|
||||||
if len(autogenerated_title) < 20:
|
if len(autogenerated_title) < 20:
|
||||||
title = '[Microblog] ' + autogenerated_title
|
title = '[Microblog] ' + autogenerated_title.strip()
|
||||||
else:
|
else:
|
||||||
title = autogenerated_title
|
title = autogenerated_title.strip()
|
||||||
if '[NSFL]' in title.upper() or '(NSFL)' in title.upper():
|
if '[NSFL]' in title.upper() or '(NSFL)' in title.upper():
|
||||||
post.nsfl = True
|
post.nsfl = True
|
||||||
if '[NSFW]' in title.upper() or '(NSFW)' in title.upper():
|
if '[NSFW]' in title.upper() or '(NSFW)' in title.upper():
|
||||||
|
|
Loading…
Reference in a new issue