<commit_before><div class="thread-message" id="message-{{mid}}" data-mid="{{mid}}">
  {% set from = metadata.from %}
  {% set url_danger = metadata.flags.spam %}
  {% include("partials/thread_metadata.html") %}
  {% set encryption_context = message.crypto.encryption.context %}
  {% set signature_context = message.crypto.signature.context %}
  {# If no text_part, show html_part }
  {% if not message.text_parts %}
    {% for part in message.html_parts %}
    {% if part.data %}
    Yay, I am some part.data: {{part.data}}
    <iframe class="thread-item-html" onload="mailpile.thread_html_iframe(this)" sandbox="allow-same-origin allow-popups allow-top-navigation" seamless target="_blank" srcdoc="{{part.data }}"></iframe>
    {% else %}
    <div class="thread-item-text"><em>{{_("Message content is empty")}}</em></div>
    {% endif %}
    {% endfor %}
  {% endif #}
  {% if message.text_parts %}
    {% set special_text_parts = [] %}
    {% set last_part = message.text_parts|length - 1 %}
    {% for part in message.text_parts %}
      {# Parts that do not have own crypto attribute inherit from message itself
       # Watch for changes to the "context" which is present in each encryption and
       # signature section - if either has changed, then we have moved from
       # one security context to the next, and need to let the user know.
       #}
      {% if part.data %}
        {% if part.crypto %}
        {# FIXME: Hiding this until issue #678 is resolved

        <div class="thread-item-crypto clearfix">
              {% if part.crypto.encryption %}
              {% if part.crypto.encryption.context != encryption_context %}
              {% set encryption_context = part.crypto.encryption.context %}
              {% set encryption = show_message_encryption(part.crypto.encryption.status) %}
              <span class="thread-item-crypto-info" title="{{ encryption.text }}" data-crypto_color="{{ encryption.color }}" data-crypto_icon="{{ encryption.icon }}" data-crypto_message="{{ encryption.message }}">
                <span class="icon {{ encryption.color + ' ' + encryption.icon }}"></span> <span class="text {{ encryption.color }}">{{ encryption.text }}</span>
              </span>
              {% endif %}
            {% endif %}
            {% if part.crypto.signature %}
              {% if part.crypto.signature.context != signature_context and part.crypto.encryption.status in ("missingkey", "error") %}
              {% set signature_context = part.crypto.signature.context %}
              {% set signature = show_message_signature(part.crypto.signature.status) %}
              <span class="thread-item-crypto-info" title="{{ signature.text }}" data-crypto_color="{{ signature.color }}" data-crypto_icon="{{ signature.icon }}" data-crypto_message="{{ signature.message }}">
                <span class="icon {{ signature.color + ' ' + signature.icon }}"></span> <span class="text {{ signature.color }}">{{ signature.text }}</span>
              </span>
              {% endif %}
            {% endif %}
          <div class="thread-item-crypto-line left"></div>
        </div>
        #}
        {% endif %}
        {% autoescape false %}<commit_msg>Re-enabling in-message crypto state change notifications, but only when there actually is a state change (relates to #678)<commit_after><div class="thread-message" id="message-{{mid}}" data-mid="{{mid}}">
  {% set from = metadata.from %}
  {% set url_danger = metadata.flags.spam %}
  {% include("partials/thread_metadata.html") %}
  {% set encryption_context = [] %}
  {% set signature_context = [] %}
  {# If no text_part, show html_part }
  {% if not message.text_parts %}
    {% for part in message.html_parts %}
    {% if part.data %}
    Yay, I am some part.data: {{part.data}}
    <iframe class="thread-item-html" onload="mailpile.thread_html_iframe(this)" sandbox="allow-same-origin allow-popups allow-top-navigation" seamless target="_blank" srcdoc="{{part.data }}"></iframe>
    {% else %}
    <div class="thread-item-text"><em>{{_("Message content is empty")}}</em></div>
    {% endif %}
    {% endfor %}
  {% endif #}
  {% if message.text_parts %}
    {% set special_text_parts = [] %}
    {% set last_part = message.text_parts|length - 1 %}
    {% for part in message.text_parts %}
      {# Parts that do not have own crypto attribute inherit from message itself
       # Watch for changes to the "context" which is present in each encryption and
       # signature section - if either has changed, then we have moved from
       # one security context to the next, and need to let the user know.
       #}
      {% if part.data %}
        {% if part.crypto %}
        <div class="thread-item-crypto clearfix">
            {% if part.crypto.encryption %}
              {% if encryption_context and part.crypto.encryption.context != encryption_context[-1] %}
              {% set encryption = show_message_encryption(part.crypto.encryption.status) %}
              <span class="thread-item-crypto-info" title="{{ encryption.text }}" data-crypto_color="{{ encryption.color }}" data-crypto_icon="{{ encryption.icon }}" data-crypto_message="{{ encryption.message }}">
                <span class="icon {{ encryption.color + ' ' + encryption.icon }}"></span> <span class="text {{ encryption.color }}">{{ encryption.text }}</span>
              </span>
              {% endif %}
              {% do encryption_context.append(part.crypto.encryption.context) %}
            {% endif %}
            {% if part.crypto.signature %}
              {% if signature_context and part.crypto.signature.context != signature_context[-1] %}
              {#   FIXME(DISABLED BY BRE)  and part.crypto.encryption.status in ("missingkey", "error") #}
              {% set signature = show_message_signature(part.crypto.signature.status) %}
              <span class="thread-item-crypto-info" title="{{ signature.text }}" data-crypto_color="{{ signature.color }}" data-crypto_icon="{{ signature.icon }}" data-crypto_message="{{ signature.message }}">
                <span class="icon {{ signature.color + ' ' + signature.icon }}"></span> <span class="text {{ signature.color }}">{{ signature.text }}</span>
              </span>
              {% endif %}
              {% do signature_context.append(part.crypto.signature.context) %}
            {% endif %}
          <div class="thread-item-crypto-line left"></div>
        </div>
        {% endif %}
        {% autoescape false %}
{'fraction_non_alphanumeric': 0.15820433436532508, 'fraction_numerical': 0.0015479876160990713, 'mean_word_length': 2.789442815249267, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1881341', 'n_tokens_mistral': 1898, 'n_tokens_neox': 1730, 'n_words': 436}