all repos — honk @ 2d86a3c038308aaa2c0958ad5796a0a28ece273a

my fork of honk

few refinements to tags
Ted Unangst tedu@tedunangst.com
Wed, 28 Aug 2019 12:07:46 -0400
commit

2d86a3c038308aaa2c0958ad5796a0a28ece273a

parent

661e183b37c4b55fcff48b2d54365b9795514a81

3 files changed, 9 insertions(+), 6 deletions(-)

jump to
M activity.goactivity.go

@@ -678,6 +678,7 @@ if tt == "Hashtag" {

xonk.Onts = append(xonk.Onts, name) } } + xonk.Onts = oneofakind(xonk.Onts) } if originate(xid) != origin { log.Printf("original sin: %s <> %s", xid, origin)

@@ -853,8 +854,7 @@ t["name"] = m.who

t["href"] = m.where tags = append(tags, t) } - ooo := ontologies(h.Noise) - for _, o := range ooo { + for _, o := range h.Onts { t := junk.New() t["type"] = "Hashtag" o = strings.ToLower(o)
M honk.gohonk.go

@@ -669,6 +669,9 @@ continue

} onts = append(onts, []string{o, o[1:]}) } + if u == nil { + w.Header().Set("Cache-Control", "max-age=300") + } templinfo := getInfo(r) templinfo["Onts"] = onts err = readviews.Execute(w, "onts.html", templinfo)

@@ -1309,10 +1312,10 @@ log.Print(err)

} return } - onts := ontologies(honk.Noise) + honk.Onts = oneofakind(ontologies(honk.Noise)) res, err := stmtSaveHonk.Exec(userinfo.UserID, what, honk.Honker, xid, rid, dt.Format(dbtimeformat), "", aud, honk.Noise, convoy, whofore, "html", - honk.Precis, honk.Oonker, 0, strings.Join(onts, " ")) + honk.Precis, honk.Oonker, 0, strings.Join(honk.Onts, " ")) if err != nil { log.Printf("error saving honk: %s", err) http.Error(w, "something bad happened while saving", http.StatusInternalServerError)

@@ -1327,7 +1330,7 @@ http.Error(w, "something bad happened while saving", http.StatusInternalServerError)

return } } - for _, o := range onts { + for _, o := range honk.Onts { _, err = stmtSaveOnts.Exec(strings.ToLower(o), honk.ID) if err != nil { log.Printf("error saving ont: %s", err)
M upgradedb.goupgradedb.go

@@ -146,7 +146,7 @@ }

onts := ontologies(noise) mo := re_more.FindAllString(noise, -1) for _, o := range mo { - onts = append(onts, "#" + o[7:]) + onts = append(onts, "#"+o[7:]) } if len(onts) > 0 { ontmap[honkid] = oneofakind(onts)