diff options
| author | 2019-09-07 17:44:20 +0100 | |
|---|---|---|
| committer | 2019-09-07 17:44:20 +0100 | |
| commit | 40d98b00345e0dc4685906dc1d279ac5d0b856a7 (patch) | |
| tree | 7982d752e5da0f9f10d7db02ae05f099bf822e23 /modules | |
| parent | only strip "nick: " prefix from karma when the nickname is known (diff) | |
| signature | ||
only strip "@" once from the start of fedi usernames
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/fediverse.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |
