diff --git a/activity.go b/activity.go index 12c9cba..baf30d0 100644 --- a/activity.go +++ b/activity.go @@ -1272,7 +1272,7 @@ func collectiveaction(honk *Honk) { } } -func junkuser(user *WhatAbout) []byte { +func junkuser(user *WhatAbout) junk.Junk { about := markitzero(user.About) j := junk.New() @@ -1306,7 +1306,7 @@ func junkuser(user *WhatAbout) []byte { k["publicKeyPem"] = user.Key j["publicKey"] = k - return j.ToBytes() + return j } var oldjonkers = cache.New(cache.Options{Filler: func(name string) ([]byte, bool) { @@ -1314,7 +1314,10 @@ var oldjonkers = cache.New(cache.Options{Filler: func(name string) ([]byte, bool if err != nil { return nil, false } - return junkuser(user), true + var buf bytes.Buffer + j := junkuser(user) + j.Write(&buf) + return buf.Bytes(), true }, Duration: 1 * time.Minute}) func asjonker(name string) ([]byte, bool) { @@ -1535,8 +1538,7 @@ func updateMe(username string) { j["published"] = dt j["to"] = []string{thewholeworld, user.URL + "/followers"} j["type"] = "Update" - jo, _ := asjonker(username) - j["object"] = jo + j["object"] = junkuser(user) msg := j.ToBytes() diff --git a/docs/changelog.txt b/docs/changelog.txt index 917f49b..41860e3 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -1,5 +1,11 @@ changelog +=== next + ++ Fix update activity. + ++ A few API refinements and additions. + === 0.9.0 Monitor vs Merrimack --- Add Reactions. diff --git a/web.go b/web.go index 5a985e0..4bb28b4 100644 --- a/web.go +++ b/web.go @@ -562,7 +562,7 @@ func serveractor(w http.ResponseWriter, r *http.Request) { return } j := junkuser(user) - w.Write(j) + j.Write(w) } func ximport(w http.ResponseWriter, r *http.Request) {