diff options
Diffstat (limited to 'internal/uris/uri.go')
-rw-r--r-- | internal/uris/uri.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/internal/uris/uri.go b/internal/uris/uri.go index 159508176..e1783b26c 100644 --- a/internal/uris/uri.go +++ b/internal/uris/uri.go @@ -46,7 +46,8 @@ const ( FileserverPath = "fileserver" // FileserverPath is a path component for serving attachments + media EmojiPath = "emoji" // EmojiPath represents the activitypub emoji location TagsPath = "tags" // TagsPath represents the activitypub tags location - AcceptsPath = "accepts" // AcceptsPath represents the activitypub accepts location + AcceptsPath = "accepts" // AcceptsPath represents the activitypub Accept's location + RejectsPath = "rejects" // RejectsPath represents the activitypub Reject's location ) // UserURIs contains a bunch of UserURIs and URLs for a user, host, account, etc. @@ -137,7 +138,7 @@ func GenerateURIForEmailConfirm(token string) string { return fmt.Sprintf("%s://%s/%s?token=%s", protocol, host, ConfirmEmailPath, token) } -// GenerateURIForAccept returns the AP URI for a new accept activity -- something like: +// GenerateURIForAccept returns the AP URI for a new Accept activity -- something like: // https://example.org/users/whatever_user/accepts/01F7XTH1QGBAPMGF49WJZ91XGC func GenerateURIForAccept(username string, thisAcceptID string) string { protocol := config.GetProtocol() @@ -145,6 +146,14 @@ func GenerateURIForAccept(username string, thisAcceptID string) string { return fmt.Sprintf("%s://%s/%s/%s/%s/%s", protocol, host, UsersPath, username, AcceptsPath, thisAcceptID) } +// GenerateURIForReject returns the AP URI for a new Reject activity -- something like: +// https://example.org/users/whatever_user/rejects/01F7XTH1QGBAPMGF49WJZ91XGC +func GenerateURIForReject(username string, thisRejectID string) string { + protocol := config.GetProtocol() + host := config.GetHost() + return fmt.Sprintf("%s://%s/%s/%s/%s/%s", protocol, host, UsersPath, username, RejectsPath, thisRejectID) +} + // GenerateURIsForAccount throws together a bunch of URIs for the given username, with the given protocol and host. func GenerateURIsForAccount(username string) *UserURIs { protocol := config.GetProtocol() |