[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
This commit is contained in:
tobi 2022-06-24 17:17:40 +02:00 committed by GitHub
commit 0846b76e93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 143 additions and 7 deletions

View file

@ -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)