mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 17:02:25 -05:00
rework data function to provide filesize
This commit is contained in:
parent
7d024ce74d
commit
c157b1b20b
12 changed files with 56 additions and 57 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue