mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-30 07:56:14 -06:00
more big changes
This commit is contained in:
parent
b9746a30f3
commit
4e054233da
71 changed files with 640 additions and 405 deletions
|
|
@ -48,8 +48,8 @@ func (p *processor) GetFile(ctx context.Context, account *gtsmodel.Account, form
|
|||
wantedMediaID := spl[0]
|
||||
|
||||
// get the account that owns the media and make sure it's not suspended
|
||||
acct := >smodel.Account{}
|
||||
if err := p.db.GetByID(ctx, form.AccountID, acct); err != nil {
|
||||
acct, err := p.db.GetAccountByID(ctx, form.AccountID)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("account with id %s could not be selected from the db: %s", form.AccountID, err))
|
||||
}
|
||||
if !acct.SuspendedAt.IsZero() {
|
||||
|
|
@ -91,8 +91,8 @@ func (p *processor) GetFile(ctx context.Context, account *gtsmodel.Account, form
|
|||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("media size %s not recognized for emoji", mediaSize))
|
||||
}
|
||||
case media.Attachment, media.Header, media.Avatar:
|
||||
a := >smodel.MediaAttachment{}
|
||||
if err := p.db.GetByID(ctx, wantedMediaID, a); err != nil {
|
||||
a, err := p.db.GetAttachmentByID(ctx, wantedMediaID)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorNotFound(fmt.Errorf("attachment %s could not be taken from the db: %s", wantedMediaID, err))
|
||||
}
|
||||
if a.AccountID != form.AccountID {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue