all repos — honk @ e408e753ee672520e4808fda6e138ec64ec50a98

my fork of honk

send updates for profile changes
Ted Unangst tedu@tedunangst.com
Tue, 31 Mar 2020 23:50:47 -0400
commit

e408e753ee672520e4808fda6e138ec64ec50a98

parent

4480af84ad857db9404e9e3b164181fb3db89100

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

jump to
M activity.goactivity.go

@@ -1524,3 +1524,38 @@ log.Printf("error saving handle: %s", err)

} } } + +func updateMe(username string) { + var user *WhatAbout + somenamedusers.Get(username, &user) + dt := time.Now().UTC().Format(time.RFC3339) + j := junk.New() + j["@context"] = itiswhatitis + j["id"] = fmt.Sprintf("%s/upme/%s/%d", user.URL, user.Name, time.Now().Unix()) + j["actor"] = user.URL + j["published"] = dt + j["to"] = []string{thewholeworld, user.URL + "/followers"} + j["type"] = "Update" + jo := junkuser(user) + j["object"] = jo + + msg := j.ToBytes() + + rcpts := make(map[string]bool) + for _, f := range getdubs(user.ID) { + if f.XID == user.URL { + continue + } + var box *Box + boxofboxes.Get(f.XID, &box) + if box != nil && box.Shared != "" { + rcpts["%"+box.Shared] = true + } else { + rcpts[f.XID] = true + } + } + for a := range rcpts { + go deliverate(0, user.ID, a, msg) + } +} +
M web.goweb.go

@@ -1156,6 +1156,8 @@ }

somenamedusers.Clear(u.Username) somenumberedusers.Clear(u.UserID) + updateMe(u.Username) + http.Redirect(w, r, "/account", http.StatusSeeOther) }