2020-10-19 09:12:39 -04:00
|
|
|
{%- for message in notif.messages %}
|
2016-05-09 18:14:48 -04:00
|
|
|
<tr class="{{ "historical_message" if message.is_historical else "message" }}">
|
|
|
|
<td class="sender_avatar">
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- if loop.index0 == 0 or notif.messages[loop.index0 - 1].sender_name != notif.messages[loop.index0].sender_name %}
|
|
|
|
{%- if message.sender_avatar_url %}
|
2016-05-09 18:14:48 -04:00
|
|
|
<img alt="" class="sender_avatar" src="{{ message.sender_avatar_url|mxc_to_http(32,32) }}" />
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- else %}
|
|
|
|
{%- if message.sender_hash % 3 == 0 %}
|
2019-03-01 17:02:02 -05:00
|
|
|
<img class="sender_avatar" src="https://riot.im/img/external/avatar-1.png" />
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- elif message.sender_hash % 3 == 1 %}
|
2019-03-01 17:02:02 -05:00
|
|
|
<img class="sender_avatar" src="https://riot.im/img/external/avatar-2.png" />
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- else %}
|
2019-03-01 17:02:02 -05:00
|
|
|
<img class="sender_avatar" src="https://riot.im/img/external/avatar-3.png" />
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
2016-05-09 18:14:48 -04:00
|
|
|
</td>
|
|
|
|
<td class="message_contents">
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- if loop.index0 == 0 or notif.messages[loop.index0 - 1].sender_name != notif.messages[loop.index0].sender_name %}
|
|
|
|
<div class="sender_name">{%- if message.msgtype == "m.emote" %}*{%- endif %} {{ message.sender_name }}</div>
|
|
|
|
{%- endif %}
|
2016-05-09 18:14:48 -04:00
|
|
|
<div class="message_body">
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- if message.event_type == "m.room.encrypted" %}
|
|
|
|
An encrypted message.
|
|
|
|
{%- elif message.event_type == "m.room.message" %}
|
|
|
|
{%- if message.msgtype == "m.text" %}
|
|
|
|
{{ message.body_text_html }}
|
|
|
|
{%- elif message.msgtype == "m.emote" %}
|
|
|
|
{{ message.body_text_html }}
|
|
|
|
{%- elif message.msgtype == "m.notice" %}
|
|
|
|
{{ message.body_text_html }}
|
2020-12-18 07:26:15 -05:00
|
|
|
{%- elif message.msgtype == "m.image" and message.image_url %}
|
2020-10-19 09:12:39 -04:00
|
|
|
<img src="{{ message.image_url|mxc_to_http(640, 480, scale) }}" />
|
|
|
|
{%- elif message.msgtype == "m.file" %}
|
|
|
|
<span class="filename">{{ message.body_text_plain }}</span>
|
|
|
|
{%- else %}
|
|
|
|
A message with unrecognised content.
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|
2016-04-28 05:55:32 -04:00
|
|
|
</div>
|
2016-05-09 18:14:48 -04:00
|
|
|
</td>
|
|
|
|
<td class="message_time">{{ message.ts|format_ts("%H:%M") }}</td>
|
|
|
|
</tr>
|
2020-10-19 09:12:39 -04:00
|
|
|
{%- endfor %}
|
2016-05-09 18:14:48 -04:00
|
|
|
<tr class="notif_link">
|
|
|
|
<td></td>
|
|
|
|
<td>
|
|
|
|
<a href="{{ notif.link }}">View {{ room.title }}</a>
|
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|