Use Accept ID on blog's origin

instead of the requesting user's. This closes #16
pull/29/head
Matt Baer 6 years ago
parent ed1b77ea3b
commit 3595c8163c
  1. 6
      activitypub.go

@ -12,6 +12,7 @@ import (
"github.com/writeas/activity/streams" "github.com/writeas/activity/streams"
"github.com/writeas/httpsig" "github.com/writeas/httpsig"
"github.com/writeas/impart" "github.com/writeas/impart"
"github.com/writeas/nerds/store"
"github.com/writeas/web-core/activitypub" "github.com/writeas/web-core/activitypub"
"github.com/writeas/web-core/activitystreams" "github.com/writeas/web-core/activitystreams"
"github.com/writeas/web-core/log" "github.com/writeas/web-core/log"
@ -259,9 +260,10 @@ func handleFetchCollectionInbox(app *app, w http.ResponseWriter, r *http.Request
if followID == nil { if followID == nil {
log.Error("Didn't resolve follow ID") log.Error("Didn't resolve follow ID")
} else { } else {
acceptID, err := url.Parse(followID.String() + "#accept") aID := c.FederatedAccount() + "#accept-" + store.GenerateFriendlyRandomString(20)
acceptID, err := url.Parse(aID)
if err != nil { if err != nil {
log.Error("Couldn't parse generated Accept URL '%s': %v", followID.String()+"#accept", err) log.Error("Couldn't parse generated Accept URL '%s': %v", aID, err)
} }
a.SetId(acceptID) a.SetId(acceptID)
} }

Loading…
Cancel
Save