only strip "@" once from the start of fedi usernames

This commit is contained in:
jesopo 2019-09-07 17:44:20 +01:00
parent c914870094
commit 40d98b0034

View file

@ -9,7 +9,9 @@ ACTIVITY_HEADERS = {"Accept": ("application/ld+json; "
'profile="https://www.w3.org/ns/activitystreams"')}
def _parse_username(s):
username, _, instance = s.lstrip("@").partition("@")
username, _, instance = s.partition("@")
if username.startswith("@"):
username = username[1:]
if username and instance:
return "@%s@%s" % (username, instance)
return None