all repos — honk @ e6e1fcf286d12f8ccd224e1ddba1f8ee666324e6

my fork of honk

let's try to stick with AP/AS defined locations
Ted Unangst tedu@tedunangst.com
Wed, 06 Nov 2019 15:17:53 -0500
commit

e6e1fcf286d12f8ccd224e1ddba1f8ee666324e6

parent

ac78b3f40aee8bf5bc76df8fd989dcac3412aa9a

1 files changed, 15 insertions(+), 11 deletions(-)

jump to
M activity.goactivity.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)