Simplify thread example using new native typed templates

This commit is contained in:
Tulir Asokan 2023-10-05 22:06:05 +03:00
parent a3baf06ca0
commit e6949c3509

View file

@ -17,21 +17,17 @@ templates:
# This currently requires using a jinja template as the content instead of a normal yaml map. # This currently requires using a jinja template as the content instead of a normal yaml map.
thread_or_reply: thread_or_reply:
type: m.room.message type: m.room.message
content: | variables:
{ relates_to: |
"msgtype": "m.text", {{
"body": "{{ text }}", {"rel_type": "m.thread", "event_id": event.content.get_thread_parent(), "is_falling_back": True, "m.in_reply_to": {"event_id": event.event_id}}
"m.relates_to": { if event.content.get_thread_parent()
{% if event.content.get_thread_parent() %} else {"m.in_reply_to": {"event_id": event.event_id}}
"rel_type": "m.thread", }}
"event_id": "{{ event.content.get_thread_parent() }}", content:
"is_falling_back": true, msgtype: m.text
{% endif %} body: $${text}
"m.in_reply_to": { m.relates_to: $${relates_to}
"event_id": "{{ event.event_id }}"
}
}
}
antispam: antispam:
room: room: