diff options
author | 2024-08-24 11:49:37 +0200 | |
---|---|---|
committer | 2024-08-24 11:49:37 +0200 | |
commit | f23f04e0b1d117be714bf91d5266dab219ed741e (patch) | |
tree | 0b3ddd60d51c8729949c3669993910a7f8f32a7b /internal/uris/uri.go | |
parent | [performance] ffmpeg ffprobe wrapper improvements (#3225) (diff) | |
download | gotosocial-f23f04e0b1d117be714bf91d5266dab219ed741e.tar.xz |
[feature] Interaction requests client api + settings panel (#3215)
* [feature] Interaction requests client api + settings panel
* test accept / reject
* fmt
* don't pin rejected interaction
* use single db model for interaction accept, reject, and request
* swaggor
* env sharting
* append errors
* remove ErrNoEntries checks
* change intReqID to reqID
* rename "pend" to "request"
* markIntsPending -> mark interactionsPending
* use log instead of returning error when rejecting interaction
* empty migration
* jolly renaming
* make interactionURI unique again
* swag grr
* remove unnecessary locks
* invalidate as last step
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() |