refactor email2content

This commit is contained in:
Aine
2022-09-06 18:39:35 +03:00
parent 1f896d1b26
commit 085cdf5dbf
4 changed files with 76 additions and 44 deletions

View File

@@ -7,22 +7,22 @@ import (
)
// RelatesTo block of matrix event content
func RelatesTo(noThreads bool, parentID id.EventID) *event.RelatesTo {
func RelatesTo(threads bool, parentID id.EventID) *event.RelatesTo {
if parentID == "" {
return nil
}
if noThreads {
if threads {
return &event.RelatesTo{
InReplyTo: &event.InReplyTo{
EventID: parentID,
},
Type: event.RelThread,
EventID: parentID,
}
}
return &event.RelatesTo{
Type: event.RelThread,
EventID: parentID,
InReplyTo: &event.InReplyTo{
EventID: parentID,
},
}
}