From a4288b06bf13210721c8f2fae64bc12c118f9041 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Thu, 29 Dec 2022 15:08:16 -0500 Subject: refactor --- views/profile.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 views/profile.go (limited to 'views/profile.go') diff --git a/views/profile.go b/views/profile.go new file mode 100644 index 0000000..12aae54 --- /dev/null +++ b/views/profile.go @@ -0,0 +1,21 @@ +package views + +import ( + "git.capotej.com/capotej/communique/urls" + "github.com/go-fed/activity/streams" +) + +func RenderProfile(name, domain string) (map[string]interface{}, error) { + u, err := urls.UrlInbox(name, domain) + if err != nil { + return nil, err + } + + inb := streams.NewActivityStreamsInboxProperty() + inb.SetIRI(u) + + p := streams.NewActivityStreamsService() + p.SetActivityStreamsInbox(inb) + + return streams.Serialize(p) +} -- cgit v1.2.3