Send follow accept for every follow request which was accepted

main
Bob Mottram 2022-03-13 18:02:41 +00:00
parent ee238d9890
commit 406ab7add3
1 changed files with 10 additions and 3 deletions

View File

@ -4020,6 +4020,7 @@ def _receive_follow_request(session, session_onion, session_i2p,
base_dir + '/accounts/' + handle_to_follow) base_dir + '/accounts/' + handle_to_follow)
return True return True
is_already_follower = False
if is_follower_of_person(base_dir, if is_follower_of_person(base_dir,
nickname_to_follow, domain_to_follow_full, nickname_to_follow, domain_to_follow_full,
nickname, domain_full): nickname, domain_full):
@ -4027,7 +4028,7 @@ def _receive_follow_request(session, session_onion, session_i2p,
print('DEBUG: ' + nickname + '@' + domain + print('DEBUG: ' + nickname + '@' + domain +
' is already a follower of ' + ' is already a follower of ' +
nickname_to_follow + '@' + domain_to_follow) nickname_to_follow + '@' + domain_to_follow)
return True is_already_follower = True
approve_handle = nickname + '@' + domain_full approve_handle = nickname + '@' + domain_full
@ -4057,7 +4058,8 @@ def _receive_follow_request(session, session_onion, session_i2p,
return False return False
# what is the followers policy? # what is the followers policy?
if follow_approval_required(base_dir, nickname_to_follow, if not is_already_follower and \
follow_approval_required(base_dir, nickname_to_follow,
domain_to_follow, debug, approve_handle): domain_to_follow, debug, approve_handle):
print('Follow approval is required') print('Follow approval is required')
if domain.endswith('.onion'): if domain.endswith('.onion'):
@ -4109,7 +4111,12 @@ def _receive_follow_request(session, session_onion, session_i2p,
message_json, debug, message_json['actor'], message_json, debug, message_json['actor'],
group_account) group_account)
else: else:
print('Follow request does not require approval ' + approve_handle) if is_already_follower:
print(approve_handle + ' is already a follower. ' +
'Re-sending Accept.')
else:
print('Follow request does not require approval ' +
approve_handle)
# update the followers # update the followers
account_to_be_followed = \ account_to_be_followed = \
acct_dir(base_dir, nickname_to_follow, domain_to_follow) acct_dir(base_dir, nickname_to_follow, domain_to_follow)