Bladeren bron

Protocol agnostic URL for emoticons

pull/2/head
Noah Petherbridge 6 jaren geleden
bovenliggende
commit
a994d37a9e
1 gewijzigde bestanden met toevoegingen van 4 en 1 verwijderingen
  1. +4
    -1
      rophako/model/emoticons.py

+ 4
- 1
rophako/model/emoticons.py Bestand weergeven

@@ -70,8 +70,11 @@ def render(message):
for trigger in smileys["map"][img]:
if trigger in message:
# Substitute it.
url = request.url_root.strip("/") \
.replace("http:", "") \
.replace("https:", "")
sub = """<img src="{url}" class="rophako-emoticon" alt="{trigger}" title="{trigger}">""".format(
url="{}/static/smileys/{}/{}".format(request.url_root.strip("/"), Config.emoticons.theme, img),
url="{}/static/smileys/{}/{}".format(url, Config.emoticons.theme, img),
trigger=trigger,
)
pattern = r'([^A-Za-z0-9:\-]|^){}([^A-Za-z0-9:\-]|$)'.format(re.escape(trigger))


Laden…
Annuleren
Opslaan