From b3f22c698739bdd57dab77af45a0b8a43da72ca4 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Sun, 1 Jan 2023 16:48:37 -0500 Subject: working ids and activity lookups --- urls/urls.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'urls/urls.go') diff --git a/urls/urls.go b/urls/urls.go index 5f563a7..3c08e07 100644 --- a/urls/urls.go +++ b/urls/urls.go @@ -22,6 +22,23 @@ func UrlOutbox(name, domain string) (*url.URL, error) { return u, nil } +func UrlActivity(name, domain, id string) (*url.URL, error) { + u, err := url.Parse(path.Join(domain, "actors", name, "outbox", id, "activity")) + if err != nil { + panic(err) + return nil, fmt.Errorf("could not build activity url: %w", err) + } + return u, nil +} + +func UrlNote(name, domain, id string) (*url.URL, error) { + u, err := url.Parse(path.Join("https://", domain, "actors", name, "outbox", id, "note")) + if err != nil { + return nil, fmt.Errorf("could not build note url: %w", err) + } + return u, nil +} + func UrlOutboxPage(name, domain string) (*url.URL, error) { u, err := UrlOutbox(name, domain) if err != nil { -- cgit v1.2.3