diff --git a/content.py b/content.py index ea92df0c7..400efbacb 100644 --- a/content.py +++ b/content.py @@ -879,6 +879,10 @@ def _mention_to_url(base_dir: str, http_prefix: str, if os.path.isfile(possible_cache_entry): return http_prefix + '://' + \ domain + users_path.replace('#', '/') + nickname + possible_cache_entry = \ + cache_path_start + '#' + nickname + '.json' + if os.path.isfile(possible_cache_entry): + return http_prefix + '://' + domain + '/' + nickname return http_prefix + '://' + domain + '/users/' + nickname diff --git a/follow.py b/follow.py index e37211a13..d06d9ea94 100644 --- a/follow.py +++ b/follow.py @@ -130,6 +130,11 @@ def _remove_from_follow_base(base_dir: str, if text_in_file(accept_deny_actor, approve_follows_filename): actor_found = True break + if not actor_found: + accept_deny_actor = \ + '://' + accept_deny_domain + '/' + accept_deny_nickname + if text_in_file(accept_deny_actor, approve_follows_filename): + actor_found = True if not actor_found: return try: @@ -292,6 +297,10 @@ def is_follower_of_person(base_dir: str, nickname: str, domain: str, if url in followers_str: already_following = True break + if not already_following: + url = '://' + follower_domain + '/' + follower_nickname + if url in followers_str: + already_following = True return already_following @@ -679,6 +688,10 @@ def store_follow_request(base_dir: str, if url in followers_str: already_following = True break + if not already_following: + url = '://' + domain_full + '/' + nickname + if url in followers_str: + already_following = True if already_following: if debug: diff --git a/followerSync.py b/followerSync.py index 4f8b932c8..f14e50835 100644 --- a/followerSync.py +++ b/followerSync.py @@ -69,6 +69,14 @@ def _get_followers_for_domain(base_dir: str, result.append(url) found = True break + if not found: + url = prefix + '://' + search_domain + '/' + nick + filename = base_dir + '/cache/actors/' + \ + url.replace('/', '#') + '.json' + if os.path.isfile(filename): + if url not in result: + result.append(url) + found = True elif '://' + search_domain in line_str: result.append(line_str) result.sort() diff --git a/inbox.py b/inbox.py index f7c1dafa9..1373e4ba5 100644 --- a/inbox.py +++ b/inbox.py @@ -1145,6 +1145,10 @@ def _person_receive_update(base_dir: str, if actor in person_json['id']: users_str_found = True break + if not users_str_found: + actor = update_domain_full + '/' + update_nickname + if actor in person_json['id']: + users_str_found = True if not users_str_found: if debug: print('actor: ' + actor) diff --git a/manualapprove.py b/manualapprove.py index 28902747e..4b4379256 100644 --- a/manualapprove.py +++ b/manualapprove.py @@ -178,19 +178,20 @@ def manual_approve_follow_request(session, session_onion, session_i2p, req_domain = approve_handle.split('@')[1].strip() req_prefix = http_prefix + '://' + req_domain paths = get_user_paths() - if req_prefix + '/' + req_nick in approve_follows_str: - exists = True - approve_handle_full = req_prefix + '/' + req_nick - if group_account: - approve_handle_full = '!' + approve_handle_full + for user_path in paths: + if req_prefix + user_path + req_nick in approve_follows_str: + exists = True + approve_handle_full = req_prefix + user_path + req_nick + if group_account: + approve_handle_full = '!' + approve_handle_full + break + if not exists: - for user_path in paths: - if req_prefix + user_path + req_nick in approve_follows_str: - exists = True - approve_handle_full = req_prefix + user_path + req_nick - if group_account: - approve_handle_full = '!' + approve_handle_full - break + if req_prefix + '/' + req_nick in approve_follows_str: + exists = True + approve_handle_full = req_prefix + '/' + req_nick + if group_account: + approve_handle_full = '!' + approve_handle_full if not exists: print('Manual follow accept: ' + approve_handle_full + ' not in requests file "' + diff --git a/relationships.py b/relationships.py index a99c83f4f..6cd166904 100644 --- a/relationships.py +++ b/relationships.py @@ -337,6 +337,14 @@ def _get_inactive_accounts(base_dir: str, nickname: str, domain: str, result.append(handle) found = True break + if not found: + actor = \ + http_prefix + follower_domain + '/' + \ + follower_nickname + if is_dormant(base_dir, nickname, domain, actor, + dormant_months): + result.append(handle) + found = True if found: break elif '://' in handle: