{% import "macros.html" as m %}
{% import "icons.html" as i %}
{{ i.ic('chevron-left') }}
{{ header_name }}
{{ header_subtitle }}
{% if dialog.others %}{% endif %}
{% for group in groups %}
{{ m.date_label(group.date) }}
{% for msg in group.messages %}
{% set out = msg.is_self %}
{% set t = msg.content.__class__.__name__ %}
{% set gname = is_group and not out and is_run_start(msg) %}
{% if t == 'System' %}
{{ m.content_block(msg, caps, 'tg') }}
{% else %}
{% if is_group and not out %}{% if is_run_end(msg) %}{% else %}{% endif %}{% endif %}
{% if t == 'Text' and caps.supports(msg.content) %}
{% if gname %}{{ msg.sender.name }}{% endif %}{% if msg.reply_to %}{{ m.reply_quote(msg.reply_to, 'tg') }}{% endif %}{{ msg.content.body }}{{ m.time_24(msg.timestamp) }}{% if out %} {{ m.ticks(msg.status, 'tg-read') }}{% endif %}
{% if msg.reactions %}
{% for r in msg.reactions %}{{ r.emoji }}1{% endfor %}
{% endif %}
{% elif t == 'Voice' and caps.supports(msg.content) %}
{{ m.voice_inner(msg.content) }}{{ m.time_24(msg.timestamp) }}{% if out %} {{ m.ticks(msg.status, 'tg-read') }}{% endif %}
{% else %}
{{ m.content_block(msg, caps, 'tg') }}
{{ m.time_24(msg.timestamp) }}{% if out %} {{ m.ticks(msg.status, 'tg-read') }}{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% if typing and dialog.others %}