all repos — honk @ 039b5dbdb41f685ae90055093b9d8ce2a3ff2283

my fork of honk

be more specific about attachment mediatype lookup
Ted Unangst tedu@tedunangst.com
Mon, 18 May 2020 18:09:18 -0400
commit

039b5dbdb41f685ae90055093b9d8ce2a3ff2283

parent

a9738224f00c936d1fe358b7f07ed0ab721684b5

1 files changed, 6 insertions(+), 4 deletions(-)

jump to
M activity.goactivity.go

@@ -730,10 +730,16 @@ u, ok = ua[0].(string)

if !ok { if uu, ok := ua[0].(junk.Junk); ok { u, _ = uu.GetString("href") + if mt == "" { + mt, _ = uu.GetString("mediaType") + } } } } else if uu, ok := att.GetMap("url"); ok { u, _ = uu.GetString("href") + if mt == "" { + mt, _ = uu.GetString("mediaType") + } } } name, _ := att.GetString("name")

@@ -745,10 +751,6 @@ localize := false

if numatts > 4 { log.Printf("excessive attachment: %s", at) } else if at == "Document" || at == "Image" { - if mt == "" { - log.Printf("assuming image media") - mt = "image/jpeg" - } mt = strings.ToLower(mt) log.Printf("attachment: %s %s", mt, u) if mt == "text/plain" || mt == "application/pdf" ||