all repos — honk @ 7934597a6db41099ee928fcd5e7b4ef811602d8c

my fork of honk

some fixups to grab "image" property as seen on lemmy
Ted Unangst tedu@tedunangst.com
Sat, 10 Jun 2023 23:19:31 -0400
commit

7934597a6db41099ee928fcd5e7b4ef811602d8c

parent

032dbdcfff33b20af1c5ec11c98f2a6a5361157c

1 files changed, 9 insertions(+), 1 deletions(-)

jump to
M activity.goactivity.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")