aboutsummaryrefslogtreecommitdiff
path: root/urls/urls.go
diff options
context:
space:
mode:
authorJulio Capote <jcapote@gmail.com>2023-01-01 21:48:37 +0000
committerJulio Capote <jcapote@gmail.com>2023-01-01 21:48:37 +0000
commitb3f22c698739bdd57dab77af45a0b8a43da72ca4 (patch)
tree07d4bca01bc49d71d2ddceaa89f51487f0768047 /urls/urls.go
parent71495ac61587e3380f413b4d34669a68b5cd8068 (diff)
downloadcommunique-b3f22c698739bdd57dab77af45a0b8a43da72ca4.tar.gz
working ids and activity lookups
Diffstat (limited to 'urls/urls.go')
-rw-r--r--urls/urls.go17
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 {