aboutsummaryrefslogtreecommitdiff
path: root/registry/registry.go
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2022-12-30 03:32:16 +0000
committerJulio Capote <jcapote@gmail.com>2022-12-30 03:32:16 +0000
commit74ffcfe6b2c80b7cf459798dc42bd278075ccb50 (patch)
tree231880fb4de3cf900d03c33531d2afc9603432d3 /registry/registry.go
parenta4288b06bf13210721c8f2fae64bc12c118f9041 (diff)
downloadcommunique-74ffcfe6b2c80b7cf459798dc42bd278075ccb50.tar.gz
experiment with write JSON to database and munge it for collections
Diffstat (limited to '')
-rw-r--r--registry/registry.go11
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) {