event: add support for MSC3765 rich text room topics
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans 2025-02-24 11:47:59 -07:00
commit 0115ba0258
No known key found for this signature in database
2 changed files with 19 additions and 7 deletions

View file

@ -29,12 +29,9 @@ func (content *PollResponseEventContent) SetRelatesTo(rel *RelatesTo) {
}
type MSC1767Message struct {
Text string `json:"org.matrix.msc1767.text,omitempty"`
HTML string `json:"org.matrix.msc1767.html,omitempty"`
Message []struct {
MimeType string `json:"mimetype"`
Body string `json:"body"`
} `json:"org.matrix.msc1767.message,omitempty"`
Text string `json:"org.matrix.msc1767.text,omitempty"`
HTML string `json:"org.matrix.msc1767.html,omitempty"`
Message []ExtensibleText `json:"org.matrix.msc1767.message,omitempty"`
}
type PollStartEventContent struct {

View file

@ -42,7 +42,22 @@ type ServerACLEventContent struct {
// TopicEventContent represents the content of a m.room.topic state event.
// https://spec.matrix.org/v1.2/client-server-api/#mroomtopic
type TopicEventContent struct {
Topic string `json:"topic"`
Topic string `json:"topic"`
ExtensibleTopic *ExtensibleTopic `json:"m.topic,omitempty"`
}
// ExtensibleTopic represents the contents of the m.topic field within the
// m.room.topic state event as described in [MSC3765].
//
// [MSC3765]: https://github.com/matrix-org/matrix-spec-proposals/pull/3765
type ExtensibleTopic struct {
Text []ExtensibleText `json:"m.text"`
}
// ExtensibleText represents the contents of an m.text field.
type ExtensibleText struct {
MimeType string `json:"mimetype,omitempty"`
Body string `json:"body"`
}
// TombstoneEventContent represents the content of a m.room.tombstone state event.