pass decoded username to db query when looking for mentions

This commit is contained in:
git-bruh 2021-12-01 11:58:38 +05:30
parent 819e1cdbc1
commit cef8cb0bbf
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -360,7 +360,10 @@ height=\"32\" src=\"{emote_}\" data-mx-emoticon />""",
message = message.replace(f":{emote}:", emote_) message = message.replace(f":{emote}:", emote_)
for mention in set(mentions): for mention in set(mentions):
username = self.db.fetch_user(mention).get("username") # Unquote just in-case we matched an encoded username.
username = self.db.fetch_user(urllib.parse.unquote(mention)).get(
"username"
)
if username: if username:
match = re.search(self.id_regex, mention) match = re.search(self.id_regex, mention)