add some more info to bonks.
notably adding /followers is required for pleroma to ack it.
This commit is contained in:
parent
12ca40538e
commit
e89d24ac20
|
@ -720,7 +720,11 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
|
||||||
j["id"] = user.URL + "/" + h.What + "/" + shortxid(h.XID)
|
j["id"] = user.URL + "/" + h.What + "/" + shortxid(h.XID)
|
||||||
j["actor"] = user.URL
|
j["actor"] = user.URL
|
||||||
j["published"] = dt
|
j["published"] = dt
|
||||||
|
if h.Public {
|
||||||
|
j["to"] = []string{h.Audience[0], user.URL + "/followers"}
|
||||||
|
} else {
|
||||||
j["to"] = h.Audience[0]
|
j["to"] = h.Audience[0]
|
||||||
|
}
|
||||||
if len(h.Audience) > 1 {
|
if len(h.Audience) > 1 {
|
||||||
j["cc"] = 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
|
j["object"] = jo
|
||||||
case "bonk":
|
case "bonk":
|
||||||
j["type"] = "Announce"
|
j["type"] = "Announce"
|
||||||
|
if h.Convoy != "" {
|
||||||
|
j["context"] = h.Convoy
|
||||||
|
}
|
||||||
j["object"] = h.XID
|
j["object"] = h.XID
|
||||||
case "zonk":
|
case "zonk":
|
||||||
j["type"] = "Delete"
|
j["type"] = "Delete"
|
||||||
|
|
11
honk.go
11
honk.go
|
@ -812,6 +812,10 @@ func savebonk(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
donksforhonks([]*Honk{xonk})
|
donksforhonks([]*Honk{xonk})
|
||||||
|
|
||||||
|
oonker := xonk.Oonker
|
||||||
|
if oonker == "" {
|
||||||
|
oonker = xonk.Honker
|
||||||
|
}
|
||||||
dt := time.Now().UTC()
|
dt := time.Now().UTC()
|
||||||
bonk := Honk{
|
bonk := Honk{
|
||||||
UserID: userinfo.UserID,
|
UserID: userinfo.UserID,
|
||||||
|
@ -821,14 +825,11 @@ func savebonk(w http.ResponseWriter, r *http.Request) {
|
||||||
XID: xonk.XID,
|
XID: xonk.XID,
|
||||||
Date: dt,
|
Date: dt,
|
||||||
Donks: xonk.Donks,
|
Donks: xonk.Donks,
|
||||||
Audience: []string{thewholeworld},
|
Convoy: xonk.Convoy,
|
||||||
|
Audience: []string{oonker, thewholeworld},
|
||||||
Public: true,
|
Public: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
oonker := xonk.Oonker
|
|
||||||
if oonker == "" {
|
|
||||||
oonker = xonk.Honker
|
|
||||||
}
|
|
||||||
aud := strings.Join(bonk.Audience, " ")
|
aud := strings.Join(bonk.Audience, " ")
|
||||||
whofore := 2
|
whofore := 2
|
||||||
res, err := stmtSaveHonk.Exec(userinfo.UserID, "bonk", bonk.Honker, xid, "",
|
res, err := stmtSaveHonk.Exec(userinfo.UserID, "bonk", bonk.Honker, xid, "",
|
||||||
|
|
Loading…
Reference in New Issue