From 64d9c67c352b5ff1d5fdb150bf1062091a1301a2 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 1 May 2019 23:13:00 -0400 Subject: [PATCH] more than 4 attachments seems execessive, leave the rest off. --- activity.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activity.go b/activity.go index adf6c5a..fb0e4fa 100644 --- a/activity.go +++ b/activity.go @@ -518,12 +518,12 @@ func xonkxonk(user *WhatAbout, item interface{}) *Honk { 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" ||