dont mention urself in chat
parent
82b33f5247
commit
315c18cd35
|
@ -46,7 +46,7 @@ socket.on('speak', function(json) {
|
|||
}
|
||||
|
||||
chatline.classList.remove('chat-mention');
|
||||
if (text_html.includes(`<a href="/id/${vid}"`) || text.match(group_names_pattern)) {
|
||||
if (json.user_id != vid && (text_html.includes(`<a href="/id/${vid}"`) || text.match(group_names_pattern))) {
|
||||
chatline.classList.add('chat-mention');
|
||||
}
|
||||
|
||||
|
|
|
@ -290,15 +290,19 @@
|
|||
{% endmacro %}
|
||||
|
||||
{% macro chat_line_template(id, m, vlink, group_memberships_names) %}
|
||||
{% set mentioned = m and vlink in m.text_html or (m and m.quoted_message and m.quoted_message.user_id == v.id) %}
|
||||
{% set ns = namespace() %}
|
||||
{% if not mentioned %}
|
||||
{% for group_name in group_memberships_names %}
|
||||
{% if (group_name == 'everyone' and '<a href="/users"' in m.text_html) or (group_name == 'jannies' and '<a href="/admins"' in m.text_html) or '<a href="/!' ~ group_name ~ '"' in m.text_html %}
|
||||
{% set ns.group_mentioned = True %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if m and m.user_id != v.id %}
|
||||
{% set ns.mentioned = m and vlink in m.text_html or (m and m.quoted_message and m.quoted_message.user_id == v.id) %}
|
||||
{% if not ns.mentioned %}
|
||||
{% for group_name in group_memberships_names %}
|
||||
{% if (group_name == 'everyone' and '<a href="/users"' in m.text_html) or (group_name == 'jannies' and '<a href="/admins"' in m.text_html) or '<a href="/!' ~ group_name ~ '"' in m.text_html %}
|
||||
{% set ns.group_mentioned = True %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<div class="chat-line {% if mentioned or ns.group_mentioned %}chat-mention{% endif %}" {% if m %}id="{{id}}"{% endif %}>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="text-muted chat-line-content">
|
||||
|
|
Loading…
Reference in New Issue