all repos — honk @ ea1fc7ecbef4097d77beab7c56f1b2439d1e4410

my fork of honk

add the function used for user updates...
Ted Unangst tedu@tedunangst.com
Tue, 05 Nov 2019 01:51:28 -0500
commit

ea1fc7ecbef4097d77beab7c56f1b2439d1e4410

parent

fd3ea6b86b58eec7a6787aee5558349d009e3569

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

jump to
M bloat.gobloat.go

@@ -14,3 +14,44 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF

// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. package main + +import ( + "fmt" + "time" + + "humungus.tedunangst.com/r/webs/junk" +) + +func updateMe() { + var user *WhatAbout + somenumberedusers.Get(1, &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 { + deliverate(0, user.ID, a, msg) + } +}