try to fix up page content for lemmy

This commit is contained in:
Ted Unangst 2023-01-04 11:29:40 -05:00
parent c6020c0931
commit 2cca5a2be8
1 changed files with 6 additions and 0 deletions

View File

@ -541,6 +541,7 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
var xid, rid, url, convoy string var xid, rid, url, convoy string
var replies []string var replies []string
var obj junk.Junk var obj junk.Junk
waspage := false
switch what { switch what {
case "Delete": case "Delete":
obj, ok = item.GetMap("object") obj, ok = item.GetMap("object")
@ -664,6 +665,7 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
case "Article": case "Article":
fallthrough fallthrough
case "Page": case "Page":
waspage = true
obj = item obj = item
what = "honk" what = "honk"
case "Event": case "Event":
@ -736,6 +738,10 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
if sens, _ := obj["sensitive"].(bool); sens && precis == "" { if sens, _ := obj["sensitive"].(bool); sens && precis == "" {
precis = "unspecified horror" precis = "unspecified horror"
} }
if waspage {
content += fmt.Sprintf(`<p><a href="%s">%s</a>`, url, url)
url = xid
}
rid, ok = obj.GetString("inReplyTo") rid, ok = obj.GetString("inReplyTo")
if !ok { if !ok {
if robj, ok := obj.GetMap("inReplyTo"); ok { if robj, ok := obj.GetMap("inReplyTo"); ok {