diff options
author | Julio Capote <jcapote@gmail.com> | 2022-12-30 03:32:16 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2022-12-30 03:32:16 +0000 |
commit | 74ffcfe6b2c80b7cf459798dc42bd278075ccb50 (patch) | |
tree | 231880fb4de3cf900d03c33531d2afc9603432d3 /registry/registry.go | |
parent | a4288b06bf13210721c8f2fae64bc12c118f9041 (diff) | |
download | communique-74ffcfe6b2c80b7cf459798dc42bd278075ccb50.tar.gz |
experiment with write JSON to database and munge it for collections
Diffstat (limited to 'registry/registry.go')
-rw-r--r-- | registry/registry.go | 11 |
1 files changed, 8 insertions, 3 deletions
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) { |