summaryrefslogtreecommitdiff
path: root/internal/processing/media/media.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-06-24 17:17:40 +0200
committerLibravatar GitHub <noreply@github.com>2022-06-24 17:17:40 +0200
commit0846b76e9343fd90a33f5a8864f39cf071d3841e (patch)
treef5bc3b506cd87b09a46d6f17982c3633c909b14f /internal/processing/media/media.go
parent[bugfix] allow setting empty email via instance patch (#665) (diff)
downloadgotosocial-0846b76e9343fd90a33f5a8864f39cf071d3841e.tar.xz
[bugfix] Fix 404 on status delete redraft (#668)
* add unattach function to media processor * call delete or unattach appropriately unattach from client api, delete from federated api * typo fix
Diffstat (limited to 'internal/processing/media/media.go')
-rw-r--r--internal/processing/media/media.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/processing/media/media.go b/internal/processing/media/media.go
index 05bea615f..50cbc1b3c 100644
--- a/internal/processing/media/media.go
+++ b/internal/processing/media/media.go
@@ -37,6 +37,9 @@ type Processor interface {
Create(ctx context.Context, account *gtsmodel.Account, form *apimodel.AttachmentRequest) (*apimodel.Attachment, gtserror.WithCode)
// Delete deletes the media attachment with the given ID, including all files pertaining to that attachment.
Delete(ctx context.Context, mediaAttachmentID string) gtserror.WithCode
+ // Unattach unattaches the media attachment with the given ID from any statuses it was attached to, making it available
+ // for reattachment again.
+ Unattach(ctx context.Context, account *gtsmodel.Account, mediaAttachmentID string) (*apimodel.Attachment, gtserror.WithCode)
// GetFile retrieves a file from storage and streams it back to the caller via an io.reader embedded in *apimodel.Content.
GetFile(ctx context.Context, account *gtsmodel.Account, form *apimodel.GetContentRequestForm) (*apimodel.Content, gtserror.WithCode)
GetCustomEmojis(ctx context.Context) ([]*apimodel.Emoji, gtserror.WithCode)