refactor Send(), fixes #6
This commit is contained in:
26
utils/matrix.go
Normal file
26
utils/matrix.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"maunium.net/go/mautrix/event"
|
||||
"maunium.net/go/mautrix/id"
|
||||
)
|
||||
|
||||
// RelatesTo block of matrix event content
|
||||
func RelatesTo(noThreads bool, parentID id.EventID) *event.RelatesTo {
|
||||
if parentID == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
if noThreads {
|
||||
return &event.RelatesTo{
|
||||
InReplyTo: &event.InReplyTo{
|
||||
EventID: parentID,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return &event.RelatesTo{
|
||||
Type: event.RelThread,
|
||||
EventID: parentID,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user