mirror of https://gitlab.com/bashrc2/epicyon
Improve pending Followers collection
parent
2a17367af2
commit
ca1781a33f
21
follow.py
21
follow.py
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue