forked from rDrama/rDrama
1
0
Fork 0
Aevann 2023-08-01 09:43:32 +03:00
parent 66c04d20be
commit 63c9715d7c
3 changed files with 26 additions and 7 deletions

View File

@ -65,11 +65,17 @@ function flash(){
socket.on('speak', function(json) {
let text = json['text']
let text
let text_html
if (slurreplacer != '0') text_html = json['text_censored']
else text_html = json['text_html']
if (slurreplacer != '0') {
text = json['text_censored']
text_html = json['text_html_censored']
}
else {
text = json['text']
text_html = json['text_html']
}
chatline.classList.remove('chat-mention');
if (text_html.includes(`<a href="/id/${vid}">`)){

View File

@ -132,8 +132,9 @@ def speak(data, v):
"username": v.username,
"namecolor": v.name_color,
"text": text,
"text_censored": censor_slurs(text, 'chat'),
"text_html": text_html,
"text_censored": censor_slurs(text_html, 'chat'),
"text_html_censored": censor_slurs(text_html, 'chat'),
"time": int(time.time()),
}

View File

@ -252,7 +252,11 @@
</span></span>:
<em class="QuotedMessage text-break">
{%- if quote_exists -%}
{{messages[m['quotes']]['text']}}
{%- if v.slurreplacer -%}
{{messages[m['quotes']]['text_censored']}}
{%- else -%}
{{messages[m['quotes']]['text']}}
{%- endif -%}
{%- endif -%}
</em>
</a>
@ -262,13 +266,21 @@
<span class="chat-message text-black text-break">
{% if m %}
{% if v.slurreplacer %}
{{m['text_censored'] | safe}}
{{m['text_html_censored'] | safe}}
{% else %}
{{m['text_html'] | safe}}
{% endif %}
{% endif %}
</span>
<span class="text d-none">{% if m %}{{m['text']}}{% endif %}</span>
<span class="text d-none">
{%- if m -%}
{%- if v.slurreplacer -%}
{{m['text_censored']}}
{%- else -%}
{{m['text']}}
{%- endif -%}
{%- endif -%}
</span>
<i class="quote btn fas fa-reply ml-auto" data-nonce="{{g.nonce}}" data-onclick="quote(this)"></i>
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<i class="btn del delconfirm fas fa-trash-alt"></i>