diff options
author | 2022-09-02 10:56:33 +0100 | |
---|---|---|
committer | 2022-09-02 11:56:33 +0200 | |
commit | 614ab12733b991dbea9d1f7fa311a98072558727 (patch) | |
tree | 41780382cb71413566c8c87ce1ce0184c504253b /internal/federation/federatingdb/owns.go | |
parent | [feature] Emojify spoiler and content in web templates (#785) (diff) | |
download | gotosocial-614ab12733b991dbea9d1f7fa311a98072558727.tar.xz |
[performance] use GetAccountByUsernameDomain() for local account lookups to rely on cache (#793)
Signed-off-by: kim <grufwub@gmail.com>
Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/federation/federatingdb/owns.go')
-rw-r--r-- | internal/federation/federatingdb/owns.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/federation/federatingdb/owns.go b/internal/federation/federatingdb/owns.go index 6146f9c0a..c82dd847c 100644 --- a/internal/federation/federatingdb/owns.go +++ b/internal/federation/federatingdb/owns.go @@ -70,7 +70,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) { if err != nil { return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err) } - if _, err := f.db.GetLocalAccountByUsername(ctx, username); err != nil { + if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil { if err == db.ErrNoEntries { // there are no entries for this username return false, nil @@ -87,7 +87,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) { if err != nil { return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err) } - if _, err := f.db.GetLocalAccountByUsername(ctx, username); err != nil { + if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil { if err == db.ErrNoEntries { // there are no entries for this username return false, nil @@ -104,7 +104,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) { if err != nil { return false, fmt.Errorf("error parsing statuses path for url %s: %s", id.String(), err) } - if _, err := f.db.GetLocalAccountByUsername(ctx, username); err != nil { + if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil { if err == db.ErrNoEntries { // there are no entries for this username return false, nil @@ -121,7 +121,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) { if err != nil { return false, fmt.Errorf("error parsing like path for url %s: %s", id.String(), err) } - if _, err := f.db.GetLocalAccountByUsername(ctx, username); err != nil { + if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil { if err == db.ErrNoEntries { // there are no entries for this username return false, nil @@ -146,7 +146,7 @@ func (f *federatingDB) Owns(ctx context.Context, id *url.URL) (bool, error) { if err != nil { return false, fmt.Errorf("error parsing block path for url %s: %s", id.String(), err) } - if _, err := f.db.GetLocalAccountByUsername(ctx, username); err != nil { + if _, err := f.db.GetAccountByUsernameDomain(ctx, username, ""); err != nil { if err == db.ErrNoEntries { // there are no entries for this username return false, nil |