BREAKING: update mautrix to 0.15.x
This commit is contained in:
16
vendor/maunium.net/go/mautrix/event/message.go
generated
vendored
16
vendor/maunium.net/go/mautrix/event/message.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2020 Tulir Asokan
|
||||
// Copyright (c) 2023 Tulir Asokan
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
@@ -97,6 +97,9 @@ type MessageEventContent struct {
|
||||
|
||||
FileName string `json:"filename,omitempty"`
|
||||
|
||||
Mentions *Mentions `json:"m.mentions,omitempty"`
|
||||
UnstableMentions *Mentions `json:"org.matrix.msc3952.mentions,omitempty"`
|
||||
|
||||
// Edits and relations
|
||||
NewContent *MessageEventContent `json:"m.new_content,omitempty"`
|
||||
RelatesTo *RelatesTo `json:"m.relates_to,omitempty"`
|
||||
@@ -135,6 +138,12 @@ func (content *MessageEventContent) SetEdit(original id.EventID) {
|
||||
if content.Format == FormatHTML && len(content.FormattedBody) > 0 {
|
||||
content.FormattedBody = "* " + content.FormattedBody
|
||||
}
|
||||
// If the message is long, remove most of the useless edit fallback to avoid event size issues.
|
||||
if len(content.Body) > 10000 {
|
||||
content.FormattedBody = ""
|
||||
content.Format = ""
|
||||
content.Body = content.Body[:50] + "[edit fallback cut…]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +172,11 @@ func (content *MessageEventContent) GetInfo() *FileInfo {
|
||||
return content.Info
|
||||
}
|
||||
|
||||
type Mentions struct {
|
||||
UserIDs []id.UserID `json:"user_ids,omitempty"`
|
||||
Room bool `json:"room,omitempty"`
|
||||
}
|
||||
|
||||
type EncryptedFileInfo struct {
|
||||
attachment.EncryptedFile
|
||||
URL id.ContentURIString `json:"url"`
|
||||
|
||||
Reference in New Issue
Block a user