diff --git a/manual/manual.md b/manual/manual.md index 6428bab13..389586d12 100644 --- a/manual/manual.md +++ b/manual/manual.md @@ -371,6 +371,10 @@ A *counselor* is someone tasked with resolving disputes between users of the ins Devops are permitted to perform some routine administration functions, such as monitoring instance performance graphs. # Following +*"I am not a beginning. I am not an end. I am a link in a chain."* + +-- Keith Haring + On the main timeline screen at the top right of the centre column there is a search icon which looks like a magnifying glass. By convention within the fediverse the search function is also the way to look up and follow other people. Enter the handle (@name@domain) or URL of the profile page for the person that you want to follow and select *search*. If the account is found then its details will appear and you can choose to follow or not. ![Following people via search](manual-search-following.jpg) diff --git a/tests.py b/tests.py index 53da447af..cfa151a63 100644 --- a/tests.py +++ b/tests.py @@ -1757,7 +1757,7 @@ def test_follow_between_servers(base_dir: str) -> None: assert THR_BOB.is_alive() is False # queue item removed - time.sleep(4) + time.sleep(8) assert len([name for name in os.listdir(queue_path) if os.path.isfile(os.path.join(queue_path, name))]) == 0 diff --git a/webfinger.py b/webfinger.py index 8d4e082e9..46d7c4136 100644 --- a/webfinger.py +++ b/webfinger.py @@ -23,6 +23,8 @@ from utils import remove_domain_port from utils import get_user_paths from utils import get_group_paths from utils import local_actor_url +from utils import get_nickname_from_actor +from utils import get_domain_from_actor def _parse_handle(handle: str) -> (str, str, bool): @@ -298,21 +300,54 @@ def webfinger_lookup(path: str, base_dir: str, domain: str, onion_domain: str, i2p_domain: str, port: int, debug: bool) -> {}: """Lookup the webfinger endpoint for an account + GET /.well-known/webfinger?resource=acct:user@domain """ if not path.startswith('/.well-known/webfinger?'): return None handle = None res_type = 'acct' - if 'resource=' + res_type + ':' in path: + if 'resource=' + res_type + ':http' in path: + # GET /.well-known/webfinger?resource=acct:https://domain/users/nick + actor = path.split('resource=' + res_type + ':')[1] + actor = urllib.parse.unquote(actor.strip()) + wf_nickname = get_nickname_from_actor(actor) + wf_domain, port = get_domain_from_actor(actor) + if wf_nickname and wf_domain: + handle = wf_nickname + '@' + wf_domain + if debug: + print('DEBUG: WEBFINGER handle ' + handle) + elif 'resource=' + res_type + ':' in path: + # GET /.well-known/webfinger?resource=acct:nick@domain handle = path.split('resource=' + res_type + ':')[1].strip() handle = urllib.parse.unquote(handle) if debug: print('DEBUG: WEBFINGER handle ' + handle) + elif 'resource=' + res_type + '%3Ahttp' in path: + # GET /.well-known/webfinger?resource=acct%3Ahttps://domain/users/nick + actor = path.split('resource=' + res_type + '%3A')[1] + actor = urllib.parse.unquote(actor.strip()) + wf_nickname = get_nickname_from_actor(actor) + wf_domain, port = get_domain_from_actor(actor) + if wf_nickname and wf_domain: + handle = wf_nickname + '@' + wf_domain + if debug: + print('DEBUG: WEBFINGER handle ' + handle) elif 'resource=' + res_type + '%3A' in path: + # GET /.well-known/webfinger?resource=acct%3Anick@domain handle = path.split('resource=' + res_type + '%3A')[1] handle = urllib.parse.unquote(handle.strip()) if debug: print('DEBUG: WEBFINGER handle ' + handle) + elif 'resource=http' in path: + # GET /.well-known/webfinger?resource=https://domain/users/nick + actor = path.split('resource=')[1] + actor = urllib.parse.unquote(actor.strip()) + wf_nickname = get_nickname_from_actor(actor) + wf_domain, port = get_domain_from_actor(actor) + if wf_nickname and wf_domain: + handle = wf_nickname + '@' + wf_domain + if debug: + print('DEBUG: WEBFINGER handle ' + handle) if not handle: if debug: print('DEBUG: WEBFINGER handle missing')