some fixups to grab "image" property as seen on lemmy
Ted Unangst tedu@tedunangst.com
Sat, 10 Jun 2023 23:19:31 -0400
1 files changed,
9 insertions(+),
1 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -689,7 +689,9 @@ fallthrough
case "Audio": fallthrough case "Image": - preferorig = true + if what == "Image" { + preferorig = true + } fallthrough case "Video": fallthrough@@ -837,6 +839,9 @@ numatts := 0
procatt := func(att junk.Junk) { at, _ := att.GetString("type") mt, _ := att.GetString("mediaType") + if mt == "" { + mt = "image" + } u, ok := att.GetString("url") if !ok { u, ok = att.GetString("href")@@ -889,6 +894,9 @@ if donk != nil {
xonk.Donks = append(xonk.Donks, donk) } numatts++ + } + if img, ok := obj.GetMap("image"); ok { + procatt(img) } if preferorig { atts, _ := obj.GetArray("url")