all repos — honk @ eccd76a3b4ce0046e5c0242b9d2a7baf59db0222

my fork of honk

handle the case where the tag is just an object
Ted Unangst tedu@tedunangst.com
Sat, 29 Jul 2023 15:04:11 -0400
commit

eccd76a3b4ce0046e5c0242b9d2a7baf59db0222

parent

86c8cfdcb6e05292962841a8beef85f1173afc5c

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

jump to
M activity.goactivity.go

@@ -967,12 +967,7 @@ if att, ok := obj.GetMap("attachment"); ok {

procatt(att) } } - tags, _ := obj.GetArray("tag") - for _, tagi := range tags { - tag, ok := tagi.(junk.Junk) - if !ok { - continue - } + proctag := func(tag junk.Junk) { tt, _ := tag.GetString("type") name, _ := tag.GetString("name") desc, _ := tag.GetString("summary")

@@ -1016,6 +1011,18 @@ m.Who, _ = tag.GetString("name")

m.Where, _ = tag.GetString("href") mentions = append(mentions, m) } + } + tags, _ := obj.GetArray("tag") + for _, tagi := range tags { + tag, ok := tagi.(junk.Junk) + if !ok { + continue + } + proctag(tag) + } + tag, ok := obj.GetMap("tag") + if ok { + proctag(tag) } if starttime, ok := obj.GetString("startTime"); ok { if start, err := time.Parse(time.RFC3339, starttime); err == nil {