2023-08-08 18:17:04 +00:00
|
|
|
package interactions
|
|
|
|
|
2023-08-09 18:36:44 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"owl-blogs/domain/model"
|
|
|
|
"owl-blogs/render"
|
|
|
|
)
|
2023-08-08 18:17:04 +00:00
|
|
|
|
|
|
|
type Webmention struct {
|
|
|
|
model.InteractionBase
|
2023-08-09 18:10:51 +00:00
|
|
|
meta WebmentionMetaData
|
2023-08-08 18:17:04 +00:00
|
|
|
}
|
|
|
|
|
2023-08-09 18:10:51 +00:00
|
|
|
type WebmentionMetaData struct {
|
2023-08-08 18:17:04 +00:00
|
|
|
Source string
|
|
|
|
Target string
|
2023-08-08 19:32:24 +00:00
|
|
|
Title string
|
2023-08-08 18:17:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i *Webmention) Content() model.InteractionContent {
|
2023-08-09 18:36:44 +00:00
|
|
|
str, err := render.RenderTemplateToString("interaction/Webmention", i)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
}
|
|
|
|
return model.InteractionContent(str)
|
2023-08-08 18:17:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (i *Webmention) MetaData() interface{} {
|
|
|
|
return &i.meta
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i *Webmention) SetMetaData(metaData interface{}) {
|
2023-08-09 18:10:51 +00:00
|
|
|
i.meta = *metaData.(*WebmentionMetaData)
|
2023-08-08 18:17:04 +00:00
|
|
|
}
|