{%- if identities is defined -%} {% set identity = identities.get(entity) %} {% set nick = identity.nicknames[0] if identity.nicknames else jid %}
{%- if identity.avatar.filename %} {{ nick }} {% else %} {{nick|first|upper}} {%- endif -%}
{{ nick }} {%- endif -%}