let's try to stick with AP/AS defined locations
Ted Unangst tedu@tedunangst.com
Wed, 06 Nov 2019 15:17:53 -0500
1 files changed,
15 insertions(+),
11 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -1061,21 +1061,25 @@ i["url"] = e.ID
t["icon"] = i tags = append(tags, t) } + if len(tags) > 0 { + jo["tag"] = tags + } if p := h.Place; p != nil { t := junk.New() t["type"] = "Place" - t["name"] = p.Name - t["latitude"] = p.Latitude - t["longitude"] = p.Longitude - t["url"] = p.Url - if h.What == "event" { - jo["location"] = t - } else { - tags = append(tags, t) + if p.Name != "" { + t["name"] = p.Name } - } - if len(tags) > 0 { - jo["tag"] = tags + if p.Latitude != 0 { + t["latitude"] = p.Latitude + } + if p.Longitude != 0 { + t["longitude"] = p.Longitude + } + if p.Url != "" { + t["url"] = p.Url + } + jo["location"] = t } if t := h.Time; t != nil { jo["startTime"] = t.StartTime.Format(time.RFC3339)