let's try to stick with AP/AS defined locations

This commit is contained in:
Ted Unangst 2019-11-06 15:17:53 -05:00
parent ef507154d5
commit 5139949a5a
1 changed files with 15 additions and 11 deletions

View File

@ -1061,21 +1061,25 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
t["icon"] = i t["icon"] = i
tags = append(tags, t) tags = append(tags, t)
} }
if len(tags) > 0 {
jo["tag"] = tags
}
if p := h.Place; p != nil { if p := h.Place; p != nil {
t := junk.New() t := junk.New()
t["type"] = "Place" t["type"] = "Place"
if p.Name != "" {
t["name"] = p.Name t["name"] = p.Name
}
if p.Latitude != 0 {
t["latitude"] = p.Latitude t["latitude"] = p.Latitude
}
if p.Longitude != 0 {
t["longitude"] = p.Longitude t["longitude"] = p.Longitude
}
if p.Url != "" {
t["url"] = p.Url t["url"] = p.Url
if h.What == "event" { }
jo["location"] = t jo["location"] = t
} else {
tags = append(tags, t)
}
}
if len(tags) > 0 {
jo["tag"] = tags
} }
if t := h.Time; t != nil { if t := h.Time; t != nil {
jo["startTime"] = t.StartTime.Format(time.RFC3339) jo["startTime"] = t.StartTime.Format(time.RFC3339)