From 40d98b00345e0dc4685906dc1d279ac5d0b856a7 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sat, 7 Sep 2019 17:44:20 +0100 Subject: [PATCH] only strip "@" once from the start of fedi usernames --- modules/fediverse.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/fediverse.py b/modules/fediverse.py index 5cd0ec45..ea2a79a5 100644 --- a/modules/fediverse.py +++ b/modules/fediverse.py @@ -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