From 583765f259ae9d7a70722dd8a9af24dd7eefce15 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 27 Apr 2022 17:03:25 +0200 Subject: [PATCH] czx --- files/helpers/sanitize.py | 11 +++++------ files/templates/authforms.html | 4 ++-- files/templates/chat.html | 2 +- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- 11 files changed, 19 insertions(+), 20 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 9c41067d1f..d3f27cfa4a 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -109,17 +109,16 @@ def render_emoji(html, regexp, edit, marseys_used=set(), b=False): emoji_partial = ':{0}:' emoji_html = None - if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs) - elif emoji.endswith('pat'): + if emoji.endswith('pat'): if path.isfile(f"files/assets/images/emojis/{emoji.replace('pat','')}.webp"): - pat(emoji.replace('pat','')) - emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs) - requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/e/{emoji}.webp"]}, timeout=5) + attrs += ' pat' + emoji_html = f'{emoji_partial.format(old, f"/e/{emoji[:-3]}.webp", attrs)}' elif emoji.startswith('@'): if u := get_user(emoji[1:-3], graceful=True): attrs += ' pat' emoji_html = f'{emoji_partial.format(old, f"/pp/{u.id}", attrs)}' + elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'): + emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs) if emoji_html: diff --git a/files/templates/authforms.html b/files/templates/authforms.html index ee16f6aacc..3c53b0fa9b 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/chat.html b/files/templates/chat.html index 1d1275dd04..b20d0f50ca 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -14,7 +14,7 @@ Chat - + {% if v.css %} diff --git a/files/templates/default.html b/files/templates/default.html index 36f87e22bc..8868f85a83 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 0471983eef..9b4bc5e942 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 8767ee3e55..1b44b6e965 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 0be66a3bef..94139306e2 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 1a3d2fb969..2db1990011 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -34,7 +34,7 @@ - + {% if v.agendaposter %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 8682377ee9..a23a47f75d 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index f6bab5267a..a283679362 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - +