Make "Announce" "To" property an array according to

https://git.pleroma.social/pleroma/pleroma/issues/1326#note_43069
pull/15/head
Michael Demetriou 2019-10-21 13:24:29 +03:00
parent 6ca250bcf4
commit 5bbc0fca4c
1 changed files with 4 additions and 3 deletions

View File

@ -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"