more than 4 attachments seems execessive, leave the rest off.
Ted Unangst tedu@tedunangst.com
Wed, 01 May 2019 23:13:00 -0400
1 files changed,
2 insertions(+),
2 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -518,12 +518,12 @@ if ot == "Tombstone" {
rid, _ = jsongetstring(obj, "id") } atts, _ := jsongetarray(obj, "attachment") - for _, att := range atts { + for i, att := range atts { at, _ := jsongetstring(att, "type") mt, _ := jsongetstring(att, "mediaType") u, _ := jsongetstring(att, "url") name, _ := jsongetstring(att, "name") - if at == "Document" || at == "Image" { + if i < 4 && (at == "Document" || at == "Image") { mt = strings.ToLower(mt) log.Printf("attachment: %s %s", mt, u) if mt == "image/jpeg" || mt == "image/png" ||