2016-05-10 01:14:48 +03:00
|
|
|
{% for message in notif.messages %}
|
|
|
|
<tr class="{{ "historical_message" if message.is_historical else "message" }}">
|
|
|
|
<td class="sender_avatar">
|
|
|
|
{% if loop.index0 == 0 or notif.messages[loop.index0 - 1].sender_name != notif.messages[loop.index0].sender_name %}
|
2016-04-28 12:55:32 +03:00
|
|
|
{% if message.sender_avatar_url %}
|
2016-05-10 01:14:48 +03:00
|
|
|
<img alt="" class="sender_avatar" src="{{ message.sender_avatar_url|mxc_to_http(32,32) }}" />
|
2016-04-28 12:55:32 +03:00
|
|
|
{% else %}
|
|
|
|
{% if message.sender_hash % 3 == 0 %}
|
|
|
|
<img class="sender_avatar" src="https://vector.im/beta/img/76cfa6.png" />
|
|
|
|
{% elif message.sender_hash % 3 == 1 %}
|
|
|
|
<img class="sender_avatar" src="https://vector.im/beta/img/50e2c2.png" />
|
|
|
|
{% else %}
|
|
|
|
<img class="sender_avatar" src="https://vector.im/beta/img/f4c371.png" />
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2016-05-10 01:14:48 +03:00
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td class="message_contents">
|
|
|
|
{% if loop.index0 == 0 or notif.messages[loop.index0 - 1].sender_name != notif.messages[loop.index0].sender_name %}
|
2016-05-31 22:28:42 +03:00
|
|
|
<div class="sender_name">{% if message.msgtype == "m.emote" %}*{% endif %} {{ message.sender_name }}</div>
|
2016-05-10 01:14:48 +03:00
|
|
|
{% endif %}
|
|
|
|
<div class="message_body">
|
|
|
|
{% if message.msgtype == "m.text" %}
|
|
|
|
{{ message.body_text_html }}
|
2016-05-31 22:28:42 +03:00
|
|
|
{% elif message.msgtype == "m.emote" %}
|
|
|
|
{{ message.body_text_html }}
|
|
|
|
{% elif message.msgtype == "m.notice" %}
|
|
|
|
{{ message.body_text_html }}
|
2016-05-10 01:14:48 +03:00
|
|
|
{% elif message.msgtype == "m.image" %}
|
|
|
|
<img src="{{ message.image_url|mxc_to_http(640, 480, scale) }}" />
|
|
|
|
{% elif message.msgtype == "m.file" %}
|
|
|
|
<span class="filename">{{ message.body_text_plain }}</span>
|
|
|
|
{% endif %}
|
2016-04-28 12:55:32 +03:00
|
|
|
</div>
|
2016-05-10 01:14:48 +03:00
|
|
|
</td>
|
|
|
|
<td class="message_time">{{ message.ts|format_ts("%H:%M") }}</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
<tr class="notif_link">
|
|
|
|
<td></td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ notif.link }}">View {{ room.title }}</a>
|
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|