Improve pending Followers collection

main
Bob Mottram 2023-07-11 13:02:58 +01:00
parent 2a17367af2
commit ca1781a33f
1 changed files with 16 additions and 5 deletions

View File

@ -1581,9 +1581,20 @@ def pending_followers_timeline_json(actor: str, base_dir: str,
if len(follower_handle) == 0: if len(follower_handle) == 0:
continue continue
follower_handle = remove_eol(follower_handle) follower_handle = remove_eol(follower_handle)
foll_json = { foll_domain, _ = get_domain_from_actor(follower_handle)
"type": "Follow", if not foll_domain:
"actor": follower_handle continue
} foll_nickname = get_nickname_from_actor(follower_handle)
result_json['orderedItems'].append(foll_json) if not foll_nickname:
continue
follow_activity_filename = \
acct_dir(base_dir, nickname, domain) + \
'/requests/' + \
foll_nickname + '@' + foll_domain + '.follow'
if not os.path.isfile(follow_activity_filename):
continue
follow_json = load_json(follow_activity_filename)
if not follow_json:
continue
result_json['orderedItems'].append(follow_json)
return result_json return result_json