Update if account is a bot or not when refreshing user profiles #334

This commit is contained in:
freamon 2024-10-04 10:50:13 +00:00
parent f4ad10e4c4
commit 4cfcc69648

View file

@ -491,6 +491,8 @@ def refresh_user_profile_task(user_id):
user.about_html = markdown_to_html(user.about) # prefer Markdown if provided, overwrite version obtained from HTML user.about_html = markdown_to_html(user.about) # prefer Markdown if provided, overwrite version obtained from HTML
else: else:
user.about = html_to_text(user.about_html) user.about = html_to_text(user.about_html)
if 'type' in activity_json:
user.bot = True if activity_json['type'] == 'Service' else False
user.ap_fetched_at = utcnow() user.ap_fetched_at = utcnow()
user.public_key = activity_json['publicKey']['publicKeyPem'] user.public_key = activity_json['publicKey']['publicKeyPem']
user.indexable = new_indexable user.indexable = new_indexable