support webfinger resource not having "acct:" on the front

This commit is contained in:
jesopo 2019-09-10 16:51:08 +01:00
parent e048f61c73
commit e96783dfac

View file

@ -152,9 +152,11 @@ class Module(ModuleManager.BaseModule):
our_username, our_instance = self._ap_self() our_username, our_instance = self._ap_self()
resource = event["params"].get("resource", None) resource = event["params"].get("resource", None)
if resource and resource.startswith("acct:"): if resource.startswith("acct:"):
request = resource.split(":", 1)[1] resource = resource.split(":", 1)[1]
requested_username, requested_instance = _parse_username(request)
if resource:
requested_username, requested_instance = _parse_username(resource)
if (requested_username == our_username and if (requested_username == our_username and
requested_instance == our_instance): requested_instance == our_instance):