all repos — honk @ 2532e0bf7e7bffc4abc00f4931dd6d4521985b67

my fork of honk

add empty follow collections
Ted Unangst tedu@tedunangst.com
Thu, 25 Apr 2019 00:35:19 -0400
commit

2532e0bf7e7bffc4abc00f4931dd6d4521985b67

parent

b82c6fd98fb905ceb173ed95d4b52dd2fb874109

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

jump to
M activity.goactivity.go

@@ -695,6 +695,8 @@ j["id"] = user.URL

j["type"] = "Person" j["inbox"] = user.URL + "/inbox" j["outbox"] = user.URL + "/outbox" + j["followers"] = user.URL + "/followers" + j["following"] = user.URL + "/following" j["name"] = user.Display j["preferredUsername"] = user.Name j["summary"] = about
M honk.gohonk.go

@@ -395,6 +395,29 @@ w.Header().Set("Content-Type", theonetruename)

WriteJunk(w, j) } +func emptiness(w http.ResponseWriter, r *http.Request) { + name := mux.Vars(r)["name"] + user, err := butwhatabout(name) + if err != nil { + http.NotFound(w, r) + return + } + colname := "/followers" + if strings.HasSuffix(r.URL.Path, "/following") { + colname = "/following" + } + j := NewJunk() + j["@context"] = itiswhatitis + j["id"] = user.URL + colname + j["type"] = "OrderedCollection" + j["totalItems"] = 0 + j["orderedItems"] = []interface{}{} + + w.Header().Set("Cache-Control", "max-age=60") + w.Header().Set("Content-Type", theonetruename) + WriteJunk(w, j) +} + func viewuser(w http.ResponseWriter, r *http.Request) { name := mux.Vars(r)["name"] user, err := butwhatabout(name)

@@ -1135,6 +1158,8 @@ getters.HandleFunc("/u/{name:[[:alnum:]]+}/h/{xid:[[:alnum:]]+}", viewhonk)

getters.HandleFunc("/u/{name:[[:alnum:]]+}/rss", showrss) posters.HandleFunc("/u/{name:[[:alnum:]]+}/inbox", inbox) getters.HandleFunc("/u/{name:[[:alnum:]]+}/outbox", outbox) + getters.HandleFunc("/u/{name:[[:alnum:]]+}/followers", emptiness) + getters.HandleFunc("/u/{name:[[:alnum:]]+}/following", emptiness) getters.HandleFunc("/a", avatate) getters.HandleFunc("/t", viewconvoy) getters.HandleFunc("/d/{xid:[[:alnum:].]+}", servefile)