From 5bbc0fca4c93cf8443f8b81c74893fe8abacfeb9 Mon Sep 17 00:00:00 2001 From: Michael Demetriou Date: Mon, 21 Oct 2019 13:24:29 +0300 Subject: [PATCH] Make "Announce" "To" property an array according to https://git.pleroma.social/pleroma/pleroma/issues/1326#note_43069 --- actor.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/actor.go b/actor.go index 52c6b8a..968288f 100644 --- a/actor.go +++ b/actor.go @@ -719,7 +719,7 @@ func (a *Actor) Unfollow(user string) { // Announce this activity to our followers func (a *Actor) Announce(url string) { // our announcements are public. Public stuff have a "To" to the url below - toURL := "https://www.w3.org/ns/activitystreams#Public" + toURL := []string{"https://www.w3.org/ns/activitystreams#Public"} hash, id := a.newItemID() announce := make(map[string]interface{}) @@ -748,7 +748,8 @@ func (a *Actor) Announce(url string) { } func (a *Actor) followersSlice() []string { - followersSlice := make([]string, len(a.followers)) + followersSlice := make([]string, 0) + followersSlice = append(followersSlice, a.followersIRI) for k := range a.followers { followersSlice = append(followersSlice, k) } @@ -784,7 +785,7 @@ func (a *Actor) Accept(follow map[string]interface{}) { accept["@context"] = "https://www.w3.org/ns/activitystreams" accept["to"] = follow["actor"] - accept["id"], _ = a.newID() + _, accept["id"] = a.newID() accept["actor"] = a.iri accept["object"] = follow accept["type"] = "Accept"