From 406ab7add34650aea97d34c24881af58186598e8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 13 Mar 2022 18:02:41 +0000 Subject: [PATCH] Send follow accept for every follow request which was accepted --- inbox.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/inbox.py b/inbox.py index 90718b848..abdc5c90e 100644 --- a/inbox.py +++ b/inbox.py @@ -4020,6 +4020,7 @@ def _receive_follow_request(session, session_onion, session_i2p, base_dir + '/accounts/' + handle_to_follow) return True + is_already_follower = False if is_follower_of_person(base_dir, nickname_to_follow, domain_to_follow_full, nickname, domain_full): @@ -4027,7 +4028,7 @@ def _receive_follow_request(session, session_onion, session_i2p, print('DEBUG: ' + nickname + '@' + domain + ' is already a follower of ' + nickname_to_follow + '@' + domain_to_follow) - return True + is_already_follower = True approve_handle = nickname + '@' + domain_full @@ -4057,7 +4058,8 @@ def _receive_follow_request(session, session_onion, session_i2p, return False # 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): print('Follow approval is required') if domain.endswith('.onion'): @@ -4109,7 +4111,12 @@ def _receive_follow_request(session, session_onion, session_i2p, message_json, debug, message_json['actor'], group_account) 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 account_to_be_followed = \ acct_dir(base_dir, nickname_to_follow, domain_to_follow)