{% macro attachment(attach) -%}
{% if attach.voiceNote or attach.contentType == "audio/mpeg" %} {% elif attach.contentType == "video/mp4" or attach.contentType == "video/3gpp" %} {% elif attach.contentType == "image/jpeg" or attach.contentType == "image/png" or attach.contentType == "image/gif" or attach.contentType == "image/webp" %}
{% else %} Attachment of type {{ attach.contentType }} {% endif %}
{%- endmacro %} {%- macro message_metadata(date, secure, state, isGroup, deliv_count, read_count) -%} {{ date.strftime(date_time_format) }} {% if not secure %} 🔓︎{# Open lock, text variant #} {%endif%} {% if state == "DISPLAY_TYPE_PENDING" %} ◌{# Dotted circle #} {% elif state == "DISPLAY_TYPE_SENT" %} ✓{# Checkmark #} {% elif state == "DISPLAY_TYPE_FAILED" %} ⚠{# Warning sign #} {% elif state == "DISPLAY_TYPE_DELIVERED" %} ✓✓{# Double checkmark #} {% elif state == "DISPLAY_TYPE_READ" %} ✓✓✓{# Triple checkmark #} {% endif%} {%- endmacro -%} Signal2HTML · {{ thread_name }}
{{ thread_name }}
{{ thread_subtitle }}
{% for msg in messages %} {% if "date_msg" in msg %}

{{ msg.body }}

{% else %} {% if msg.type == 'call-incoming' %}
{{ msg.event_data | safe }} called you
{% elif msg.type == 'call-outgoing' %}
You called
{% elif msg.type == 'call-missed' %}
Missed call
{% elif msg.type == 'video-call-incming' %}
Video call from {{ msg.event_data | safe }}
{% elif msg.type == 'video-call-outgoing' %}
Outgoing video call
{% elif msg.type == 'video-call-missed' %}
Missed video call
{% elif msg.type == 'group-call' %}
Group call {% if msg.event_data %}started by {{ msg.event_data | safe }}{% endif %}
{% elif msg.type == 'key-update' %}
{{msg.event_data | safe}} has a new safety number
{% elif msg.type == 'group-update-v1' or msg.type == 'group-update-v2' %}
{% if msg.event_data.header %}{{msg.event_data.header}}{% endif %}
    {% if msg.event_data.name %}
  • Name: {{msg.event_data.name}}{% endif %} {% for member_list in msg.event_data.member_lists %}
  • {{member_list.header}}
      {% for member in member_list.members %}
    • {{member | safe}} {% endfor %}
    {% endfor %}
{% if msg.attachments %} {% for attach in msg.attachments %}
Group photo
{{ attachment(attach) }} {% endfor %} {% endif %} {% if debug_messages %} {{msg.body}} {% endif %} {% else %}
{% if msg.isGroup and msg.type == 'incoming' %} {{ msg.name }} {% endif %} {% if msg.quote %}
{{ msg.quote.name }}
{{ msg.quote.body | safe }}
{% if msg.quote.attachments %}
{% for attach in msg.quote.attachments %} {{ attachment(attach) }} {% endfor %}
{% endif %}
{% endif %} {% if msg.attachments %} {% for attach in msg.attachments %} {{ attachment(attach) }} {% endfor %} {% endif %} {% if msg.body %} {% if msg.isAllEmoji %}
{% else %}
{% endif %}
{{ msg.body | safe }}
{% endif %} {% endif %} {{ message_metadata(msg.date, msg.secure, msg.send_state, msg.isGroup, msg.delivery_receipt_count, msg.read_receipt_count) }} {% if msg.reactions %}
{% for reaction in msg.reactions %} {{reaction.what}}From {{reaction.name}}
Sent {{reaction.time_sent.strftime(date_time_format)}}
Received {{reaction.time_received.strftime(date_time_format)}}
{% endfor %}
{% endif %} {% endif %}
{% endfor %}