{% set message = result.data.messages.get(mid) %}{% set message_errors = (result.errors or {}).get(mid) %}{% set metadata = result.data.metadata[mid] %}{% set thread = result.data.threads[metadata.thread_mid] %}{% set conversation_count = thread|length %}{% set cleartext = show_text_part_encryption('none') %}{% set unsigned = show_text_part_signature('none') %}{% set to_cc = metadata.to_aids + metadata.cc_aids %}{% set from = result.data.addresses[metadata.from.aid] %}{% if not from %}{% set from = {'fn': 'Unknown sender', 'email': ''} %}{% endif %}{% macro msg_url(msg_mid) %}{% set m_metadata = result.data.metadata.get(msg_mid) %}{% if m_metadata and m_metadata.urls.editing: %}{{ m_metadata.urls.editing }}{% elif True: %}{{ U(add_state_query_string(state.command_url, state, { 'url_args_remove': [['view','']], 'url_args_add': [['view', msg_mid]]})) }}{% else: %}{{ m_metadata.urls.thread }}{% endif %}{% endmacro %} {% if message or message_errors %} {%- if previous_mid %}
{%- endif %}
{%- if next_mid %}
{%- endif %} {%- if message.editing_strings %} {%- else %}

{{_("From")}}: {# # FIXME: We are using the From data given to us in the metadata section, # which may differ from the message contents, especially in a # memory-hole substitution world. This needs reworking. #}
    {%- if is_dev_version() %} {%- if not metadata.from.flags.contact and not metadata.from.flags.profile %}
  • {%- endif %} {%- endif %}

"{{metadata.from.fn}}" <{{metadata.from.address}}>
{%- for txt, which, rcpts in (('To', 'to', get_addresses(message.header_list, "to")), ('CC', 'cc', get_addresses(message.header_list, "cc")), ('BCC', 'bcc', get_addresses(message.header_list, "bcc"))) %} {%- if rcpts %}

{{_(txt)}}:

{%- for ai in rcpts %} "{{ai.fn or ai.address}}" <{{ai.address}}>, {%- endfor %}
{%- endif %} {%- endfor %} {%- if thread|length < 2 %} {%- include "partials/pile_email_hints.html" %} {%- endif %}
{%- endif %} {%- if thread|length > 1 %} {%- include "partials/pile_threading.html" %} {%- endif %} {% else %} 1 %} +{{ to_cc|length -1 }}{% endif %} {%- else %}({{_("unknown")}}){% endif %}"> {% if metadata.from.fn %}{{ metadata.from.fn|nice_name(28) }}{% else %}({{_("No Name")}}){% endif %} {% if conversation_count > 1 %}{{conversation_count}}{% endif %} {% if metadata.flags.replied %}{% else %} {% if metadata.flags.forwarded %}{% endif %} {% endif %} {%endif %} {# FIXME #} {% for tid in metadata.tag_tids %} {% set tag = result.data.tags[tid] %} {% if tag.label and not tag.searched %} {% endif %} {% endfor %} {%- if not message %} {% if metadata.crypto.encryption in ('decrypted', 'mixed-decrypted', 'lockedkey', 'mixed-lockedkey') %} {% elif metadata.crypto.encryption in ('error', 'mixed-error', 'missingkey', 'mixed-missingkey') %} {% endif %} {%- endif %} {%- if message_errors %} {% include("partials/error_message_missing.html") %} {%- elif not message %} {{ nice_subject(metadata.subject) }} {%- else %}
{%- if message.editing_strings %} {% set editing_strings = message.editing_strings %} {% set editing_addresses = result.data.addresses %} {% set attachments = message.attachments %} {% include("partials/compose.html") %} {%- else %}

{{_("Subject")}}:

{%- if message.html_parts|length > 0 %} {%- endif %}
{%- set subjects = get_all(message.header_list, "subject") %} {%- if subjects %} {%- for value in subjects %} {{ nice_subject(value) }} {%- endfor %} {%- else %} {{ nice_subject(None) }} {%- endif %}
{%- include('partials/pile_message.html') -%}
{%- endif %} {%- endif %} {{metadata.timestamp|elapsed_datetime}}