mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-16 21:37:29 -06:00
Updates....
This commit is contained in:
parent
d89d3b0c63
commit
68f3ba03b2
14 changed files with 128 additions and 316 deletions
|
|
@ -35,14 +35,14 @@ func (c *converter) ASRepresentationToAccount(accountable Accountable) (*gtsmode
|
|||
uri := uriProp.GetIRI()
|
||||
|
||||
acct := >smodel.Account{}
|
||||
if err := c.db.GetWhere("uri", uri.String(), acct); err == nil {
|
||||
err := c.db.GetWhere("uri", uri.String(), acct)
|
||||
if err == nil {
|
||||
// we already know this account so we can skip generating it
|
||||
return acct, nil
|
||||
} else {
|
||||
if _, ok := err.(db.ErrNoEntries); !ok {
|
||||
// we don't know the account and there's been a real error
|
||||
return nil, fmt.Errorf("error getting account with uri %s from the database: %s", uri.String(), err)
|
||||
}
|
||||
}
|
||||
if _, ok := err.(db.ErrNoEntries); !ok {
|
||||
// we don't know the account and there's been a real error
|
||||
return nil, fmt.Errorf("error getting account with uri %s from the database: %s", uri.String(), err)
|
||||
}
|
||||
|
||||
// we don't know the account so we need to generate it from the person -- at least we already have the URI!
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
)
|
||||
|
||||
// nolint
|
||||
type ConverterStandardTestSuite struct {
|
||||
suite.Suite
|
||||
config *config.Config
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ func (c *converter) AccountToMastoPublic(a *gtsmodel.Account) (*model.Account, e
|
|||
aviURLStatic := avi.Thumbnail.URL
|
||||
|
||||
header := >smodel.MediaAttachment{}
|
||||
if err := c.db.GetHeaderForAccountID(avi, a.ID); err != nil {
|
||||
if err := c.db.GetHeaderForAccountID(header, a.ID); err != nil {
|
||||
if _, ok := err.(db.ErrNoEntries); !ok {
|
||||
return nil, fmt.Errorf("error getting header: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue