mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
45da5175f5
|
|
@ -97,7 +97,7 @@ def _accept_follow(base_dir: str, domain: str, message_json: {},
|
||||||
print('DEBUG: No "to" parameter in follow Accept')
|
print('DEBUG: No "to" parameter in follow Accept')
|
||||||
return
|
return
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: follow Accept received')
|
print('DEBUG: follow Accept received ' + str(message_json))
|
||||||
this_actor = message_json['object']['actor']
|
this_actor = message_json['object']['actor']
|
||||||
nickname = get_nickname_from_actor(this_actor)
|
nickname = get_nickname_from_actor(this_actor)
|
||||||
if not nickname:
|
if not nickname:
|
||||||
|
|
|
||||||
14
follow.py
14
follow.py
|
|
@ -582,7 +582,7 @@ def follow_approval_required(base_dir: str, nickname_to_follow: str,
|
||||||
if os.path.isfile(actor_filename):
|
if os.path.isfile(actor_filename):
|
||||||
actor = load_json(actor_filename)
|
actor = load_json(actor_filename)
|
||||||
if actor:
|
if actor:
|
||||||
if actor.get('manually_approves_followers'):
|
if 'manuallyApprovesFollowers' in actor:
|
||||||
manually_approve_follows = actor['manuallyApprovesFollowers']
|
manually_approve_follows = actor['manuallyApprovesFollowers']
|
||||||
else:
|
else:
|
||||||
if debug:
|
if debug:
|
||||||
|
|
@ -738,8 +738,7 @@ def followed_account_accepts(session, base_dir: str, http_prefix: str,
|
||||||
accept_handle = nickname + '@' + domain
|
accept_handle = nickname + '@' + domain
|
||||||
|
|
||||||
# send accept back
|
# send accept back
|
||||||
if debug:
|
print('Sending follow Accept activity for ' +
|
||||||
print('DEBUG: sending Accept activity for ' +
|
|
||||||
'follow request which arrived at ' +
|
'follow request which arrived at ' +
|
||||||
nickname_to_follow + '@' + domain_to_follow +
|
nickname_to_follow + '@' + domain_to_follow +
|
||||||
' back to ' + accept_handle)
|
' back to ' + accept_handle)
|
||||||
|
|
@ -747,7 +746,6 @@ def followed_account_accepts(session, base_dir: str, http_prefix: str,
|
||||||
nickname_to_follow, domain_to_follow, port,
|
nickname_to_follow, domain_to_follow, port,
|
||||||
person_url, '', http_prefix,
|
person_url, '', http_prefix,
|
||||||
follow_json)
|
follow_json)
|
||||||
if debug:
|
|
||||||
pprint(accept_json)
|
pprint(accept_json)
|
||||||
print('DEBUG: sending follow Accept from ' +
|
print('DEBUG: sending follow Accept from ' +
|
||||||
nickname_to_follow + '@' + domain_to_follow +
|
nickname_to_follow + '@' + domain_to_follow +
|
||||||
|
|
@ -759,13 +757,13 @@ def followed_account_accepts(session, base_dir: str, http_prefix: str,
|
||||||
# remove the follow request json
|
# remove the follow request json
|
||||||
follow_activity_filename = \
|
follow_activity_filename = \
|
||||||
acct_dir(base_dir, nickname_to_follow, domain_to_follow) + \
|
acct_dir(base_dir, nickname_to_follow, domain_to_follow) + \
|
||||||
'/requests/' + \
|
'/requests/' + nickname + '@' + domain + '.follow'
|
||||||
nickname + '@' + domain + '.follow'
|
|
||||||
if os.path.isfile(follow_activity_filename):
|
if os.path.isfile(follow_activity_filename):
|
||||||
try:
|
try:
|
||||||
os.remove(follow_activity_filename)
|
os.remove(follow_activity_filename)
|
||||||
except OSError:
|
except OSError:
|
||||||
print('EX: followed_account_accepts unable to delete ' +
|
print('EX: follow Accept ' +
|
||||||
|
'followed_account_accepts unable to delete ' +
|
||||||
follow_activity_filename)
|
follow_activity_filename)
|
||||||
|
|
||||||
group_account = False
|
group_account = False
|
||||||
|
|
@ -1455,7 +1453,7 @@ def follower_approval_active(base_dir: str,
|
||||||
if os.path.isfile(actor_filename):
|
if os.path.isfile(actor_filename):
|
||||||
actor_json = load_json(actor_filename)
|
actor_json = load_json(actor_filename)
|
||||||
if actor_json:
|
if actor_json:
|
||||||
if actor_json.get('manuallyApprovesFollowers'):
|
if 'manuallyApprovesFollowers' in actor_json:
|
||||||
manually_approves_followers = \
|
manually_approves_followers = \
|
||||||
actor_json['manuallyApprovesFollowers']
|
actor_json['manuallyApprovesFollowers']
|
||||||
return manually_approves_followers
|
return manually_approves_followers
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue