From 326eef243c22a739588cfb74642eb9267d020dee Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sun, 18 Dec 2022 21:23:36 -0500 Subject: use streams.Serialize --- resources/outbox.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'resources/outbox.go') diff --git a/resources/outbox.go b/resources/outbox.go index 9adb817..f9a4aef 100644 --- a/resources/outbox.go +++ b/resources/outbox.go @@ -9,17 +9,26 @@ import ( ) func RenderOutbox(name, domain string) (map[string]interface{}, error) { + id, err := url.Parse(path.Join("https://", domain, "actors", name, "outbox")) + + if err != nil { + return nil, fmt.Errorf("could not partse url: %w", err) + } + first, err := url.Parse(path.Join("https://", domain, "actors", name, "outbox", "?=page=true")) if err != nil { return nil, fmt.Errorf("could not partse url: %w", err) } oc := streams.NewActivityStreamsOrderedCollection() + idProp := streams.NewJSONLDIdProperty() + idProp.Set(id) + oc.SetJSONLDId(idProp) ocProp := streams.NewActivityStreamsFirstProperty() ocProp.SetIRI(first) oc.SetActivityStreamsFirst(ocProp) - return oc.Serialize() + return streams.Serialize(oc) } -- cgit v1.2.3