handle the case where the tag is just an object
Ted Unangst tedu@tedunangst.com
Sat, 29 Jul 2023 15:04:11 -0400
1 files changed,
13 insertions(+),
6 deletions(-)
jump to
M
activity.go
→
activity.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 {