diff options
author | Julio Capote <jcapote@gmail.com> | 2023-01-01 21:48:37 +0000 |
---|---|---|
committer | Julio Capote <jcapote@gmail.com> | 2023-01-01 21:48:37 +0000 |
commit | b3f22c698739bdd57dab77af45a0b8a43da72ca4 (patch) | |
tree | 07d4bca01bc49d71d2ddceaa89f51487f0768047 /urls/urls.go | |
parent | 71495ac61587e3380f413b4d34669a68b5cd8068 (diff) | |
download | communique-b3f22c698739bdd57dab77af45a0b8a43da72ca4.tar.gz |
working ids and activity lookups
Diffstat (limited to '')
-rw-r--r-- | urls/urls.go | 17 |
1 files changed, 17 insertions, 0 deletions
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 { |