From 74ffcfe6b2c80b7cf459798dc42bd278075ccb50 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Thu, 29 Dec 2022 22:32:16 -0500 Subject: experiment with write JSON to database and munge it for collections --- registry/registry.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'registry/registry.go') diff --git a/registry/registry.go b/registry/registry.go index f57aede..8372d40 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -48,12 +48,17 @@ func (r *Registry) Outbox(name string) (map[string]interface{}, error) { return views.RenderOutbox(handler.handlerCfg.Name, r.cfg.Domain, totalItems) } -func (r *Registry) OutboxPage(name string) (map[string]interface{}, error) { +func (r *Registry) OutboxCollection(name string) (string, error) { handler := r.findByName(name) if handler == nil { - return nil, nil + return "", nil + } + aso := models.NewActivityStreamsObject(nil, handler.handlerCfg) + page, err := r.persister.Collect(aso) + if err != nil { + return "", err } - return views.RenderOutboxPage(handler.handlerCfg.Name, r.cfg.Domain) + return views.RenderOutboxCollection(handler.handlerCfg.Name, r.cfg.Domain, page) } func (r *Registry) WebfingerResource(fqn string) (*views.WebfingerResource, error) { -- cgit v1.2.3