diff --git a/activity.go b/activity.go index eda5ab2..b0f61c1 100644 --- a/activity.go +++ b/activity.go @@ -1418,6 +1418,19 @@ func junkuser(user *WhatAbout) junk.Junk { j["name"] = user.Display j["preferredUsername"] = user.Name j["summary"] = user.HTAbout + var tags []junk.Junk + for _, o := range user.Onts { + t := junk.New() + t["type"] = "Hashtag" + o = strings.ToLower(o) + t["href"] = fmt.Sprintf("https://%s/o/%s", serverName, o[1:]) + t["name"] = o + tags = append(tags, t) + } + if len(tags) > 0 { + j["tag"] = tags + } + if user.ID > 0 { j["type"] = "Person" j["url"] = user.URL diff --git a/database.go b/database.go index 14f00f2..790481b 100644 --- a/database.go +++ b/database.go @@ -59,6 +59,7 @@ func userfromrow(row *sql.Row) (*WhatAbout, error) { marker.HashLinker = ontoreplacer marker.AtLinker = attoreplacer user.HTAbout = template.HTML(marker.Mark(user.About)) + user.Onts = marker.HashTags return user, nil } diff --git a/honk.go b/honk.go index 9ff7b04..e741e18 100644 --- a/honk.go +++ b/honk.go @@ -41,6 +41,7 @@ type WhatAbout struct { Display string About string HTAbout template.HTML + Onts []string Key string URL string Options UserOptions