diff options
author | Andrew Godwin | 2022-12-04 20:22:24 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-12-04 20:23:02 -0700 |
commit | 6291fa0f5c4d30139c23c2e2f2a1daa49852c105 (patch) | |
tree | e6b904f84fe42448839e4cc5dab3ad0aaccbcabe /activities/models | |
parent | d27be3f42619e9eaf3b8ac9333b2bf5bb290aae6 (diff) | |
download | takahe-6291fa0f5c4d30139c23c2e2f2a1daa49852c105.tar.gz takahe-6291fa0f5c4d30139c23c2e2f2a1daa49852c105.tar.bz2 takahe-6291fa0f5c4d30139c23c2e2f2a1daa49852c105.zip |
Fix mentions in replies/capitalisation
Diffstat (limited to 'activities/models')
-rw-r--r-- | activities/models/post.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activities/models/post.py b/activities/models/post.py index d3365e7..aa4be16 100644 --- a/activities/models/post.py +++ b/activities/models/post.py @@ -276,7 +276,7 @@ class Post(StatorModel): def replacer(match): precursor = match.group(1) - handle = match.group(2) + handle = match.group(2).lower() if handle in possible_matches: return f'{precursor}<a href="{possible_matches[handle]}">@{handle}</a>' else: @@ -383,6 +383,7 @@ class Post(StatorModel): mention_hits = cls.mention_regex.findall(content) mentions = set() for precursor, handle in mention_hits: + handle = handle.lower() if "@" in handle: username, domain = handle.split("@", 1) else: |