rework data function to provide filesize

This commit is contained in:
tsmethurst
2022-01-23 14:41:58 +01:00
parent 7d024ce74d
commit c157b1b20b
12 changed files with 56 additions and 57 deletions

View File

@@ -36,8 +36,9 @@ func (p *processor) EmojiCreate(ctx context.Context, account *gtsmodel.Account,
return nil, gtserror.NewErrorNotAuthorized(fmt.Errorf("user %s not an admin", user.ID), "user is not an admin")
}
data := func(innerCtx context.Context) (io.Reader, error) {
return form.Image.Open()
data := func(innerCtx context.Context) (io.Reader, int, error) {
f, err := form.Image.Open()
return f, int(form.Image.Size), err
}
emojiID, err := id.NewRandomULID()