diff options
author | 2023-06-17 17:49:11 +0200 | |
---|---|---|
committer | 2023-06-17 16:49:11 +0100 | |
commit | d8e16a226a570a7d262bdeb067273ce35b03cc7c (patch) | |
tree | 94a09ebe5501c01159efb8aa3e74d70da8db2f87 /internal/federation/federatingprotocol.go | |
parent | [bugfix] Accept non-multipart forms for account updates (#1896) (diff) | |
download | gotosocial-d8e16a226a570a7d262bdeb067273ce35b03cc7c.tar.xz |
[chore/bugfix] Refactor `ap/extract.go` functions, return URIs more reliably (#1897)
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r-- | internal/federation/federatingprotocol.go | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go index 18feb2429..ec74de097 100644 --- a/internal/federation/federatingprotocol.go +++ b/internal/federation/federatingprotocol.go @@ -110,15 +110,10 @@ func (f *federator) PostInboxRequestBodyHook(ctx context.Context, r *http.Reques } } - // Check for TOs and CCs on the Activity. + // Check for TO and CC URIs on the Activity. if addressable, ok := activity.(ap.Addressable); ok { - if toURIs, err := ap.ExtractTos(addressable); err == nil { - otherIRIs = append(otherIRIs, toURIs...) - } - - if ccURIs, err := ap.ExtractCCs(addressable); err == nil { - otherIRIs = append(otherIRIs, ccURIs...) - } + otherIRIs = append(otherIRIs, ap.ExtractToURIs(addressable)...) + otherIRIs = append(otherIRIs, ap.ExtractCcURIs(addressable)...) } // Now perform the same checks, but for the Object(s) of the Activity. @@ -146,13 +141,8 @@ func (f *federator) PostInboxRequestBodyHook(ctx context.Context, r *http.Reques } if addressable, ok := t.(ap.Addressable); ok { - if toURIs, err := ap.ExtractTos(addressable); err == nil { - otherIRIs = append(otherIRIs, toURIs...) - } - - if ccURIs, err := ap.ExtractCCs(addressable); err == nil { - otherIRIs = append(otherIRIs, ccURIs...) - } + otherIRIs = append(otherIRIs, ap.ExtractToURIs(addressable)...) + otherIRIs = append(otherIRIs, ap.ExtractCcURIs(addressable)...) } } |