provide proper reply-to fallback by default

This commit is contained in:
Aine
2023-09-28 15:17:55 +03:00
parent 8bdd46fb32
commit bebfa6df92
11 changed files with 91 additions and 85 deletions

View File

@@ -1,26 +0,0 @@
package utils
import (
"maunium.net/go/mautrix/event"
"maunium.net/go/mautrix/id"
)
// RelatesTo returns relation object of a matrix event (either threads or reply-to)
func RelatesTo(threads bool, parentID id.EventID) *event.RelatesTo {
if parentID == "" {
return nil
}
if threads {
return &event.RelatesTo{
Type: event.RelThread,
EventID: parentID,
}
}
return &event.RelatesTo{
InReplyTo: &event.InReplyTo{
EventID: parentID,
},
}
}