From 4cfcc6964825e66f092d84bce007d1e3d6e33860 Mon Sep 17 00:00:00 2001 From: freamon Date: Fri, 4 Oct 2024 10:50:13 +0000 Subject: [PATCH] Update if account is a bot or not when refreshing user profiles #334 --- app/activitypub/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 25fcd060..d92d3bf2 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -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 else: 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.public_key = activity_json['publicKey']['publicKeyPem'] user.indexable = new_indexable