From e89d24ac20ac6efc8b1b63166c9bcf4f04948d70 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 26 Jun 2019 17:19:45 -0400 Subject: [PATCH] add some more info to bonks. notably adding /followers is required for pleroma to ack it. --- activity.go | 9 ++++++++- honk.go | 11 ++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/activity.go b/activity.go index e7ed0a6..c81c3bf 100644 --- a/activity.go +++ b/activity.go @@ -720,7 +720,11 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) { j["id"] = user.URL + "/" + h.What + "/" + shortxid(h.XID) j["actor"] = user.URL j["published"] = dt - j["to"] = h.Audience[0] + if h.Public { + j["to"] = []string{h.Audience[0], user.URL + "/followers"} + } else { + j["to"] = h.Audience[0] + } if len(h.Audience) > 1 { j["cc"] = h.Audience[1:] } @@ -810,6 +814,9 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) { j["object"] = jo case "bonk": j["type"] = "Announce" + if h.Convoy != "" { + j["context"] = h.Convoy + } j["object"] = h.XID case "zonk": j["type"] = "Delete" diff --git a/honk.go b/honk.go index a60e5e1..4b34c6a 100644 --- a/honk.go +++ b/honk.go @@ -812,6 +812,10 @@ func savebonk(w http.ResponseWriter, r *http.Request) { } donksforhonks([]*Honk{xonk}) + oonker := xonk.Oonker + if oonker == "" { + oonker = xonk.Honker + } dt := time.Now().UTC() bonk := Honk{ UserID: userinfo.UserID, @@ -821,14 +825,11 @@ func savebonk(w http.ResponseWriter, r *http.Request) { XID: xonk.XID, Date: dt, Donks: xonk.Donks, - Audience: []string{thewholeworld}, + Convoy: xonk.Convoy, + Audience: []string{oonker, thewholeworld}, Public: true, } - oonker := xonk.Oonker - if oonker == "" { - oonker = xonk.Honker - } aud := strings.Join(bonk.Audience, " ") whofore := 2 res, err := stmtSaveHonk.Exec(userinfo.UserID, "bonk", bonk.Honker, xid, "",