all repos — honk @ 39eb566738fc186d2a68dcb88f9c1a43bb5b1625

my fork of honk

expose ontology as ap collection
Ted Unangst tedu@tedunangst.com
Fri, 25 Oct 2019 17:59:30 -0400
commit

39eb566738fc186d2a68dcb88f9c1a43bb5b1625

parent

8c14fb9c6de790b2c62c4f690b9a4e6f9c77a944

1 files changed, 27 insertions(+), 0 deletions(-)

jump to
M web.goweb.go

@@ -535,6 +535,7 @@

j := junk.New() j["@context"] = itiswhatitis j["id"] = user.URL + "/outbox" + j["attributedTo"] = user.URL j["type"] = "OrderedCollection" j["totalItems"] = len(jonks) j["orderedItems"] = jonks

@@ -581,6 +582,7 @@ }

j := junk.New() j["@context"] = itiswhatitis j["id"] = user.URL + colname + j["attributedTo"] = user.URL j["type"] = "OrderedCollection" j["totalItems"] = 0 j["orderedItems"] = []junk.Junk{}

@@ -688,6 +690,31 @@ if u != nil {

userid = u.UserID } honks := gethonksbyontology(userid, "#"+name, 0) + if friendorfoe(r.Header.Get("Accept")) { + if len(honks) > 20 { + honks = honks[0:20] + } + + var xids []string + for _, h := range honks { + xids = append(xids, h.XID) + } + + user := getserveruser() + + j := junk.New() + j["@context"] = itiswhatitis + j["id"] = fmt.Sprintf("https://%s/o/%s", serverName, name) + j["attributedTo"] = user.URL + j["type"] = "OrderedCollection" + j["totalItems"] = len(xids) + j["orderedItems"] = xids + + w.Header().Set("Cache-Control", "max-age=300") + j.Write(w) + return + } + templinfo := getInfo(r) templinfo["ServerMessage"] = "honks by ontology: " + name templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)