diff options
author | 2023-02-03 20:03:05 +0000 | |
---|---|---|
committer | 2023-02-03 20:03:05 +0000 | |
commit | 33aee1b1e974e99182a95ce1a05e2be924d19bb2 (patch) | |
tree | 1471623039f70325a0b7a1c25dd4fe3afc883970 /internal/federation/dereference.go | |
parent | [feature/frogend] (Mastodon) domain block CSV import (#1390) (diff) | |
download | gotosocial-33aee1b1e974e99182a95ce1a05e2be924d19bb2.tar.xz |
[chore] reformat GetAccount() functionality, support updating accounts based on last_fetch (#1411)
* reformat GetAccount() functionality, and add UpdateAccount() function.
* use fetched_at instead of last_webfingered_at
* catch local "not found" errors. small formatting / error string changes
* remove now unused error type
* return nil when wrapping nil error
* update expected error messages
* return correct url for foss satan webfinger
* add AP model for Some_User
* normalize local domain
* return notretrievable where appropriate
* expose NewErrNotRetrievable
* ensure webfinger for new accounts searched by uri
* update local account short circuit
* allow enrich to fail for already-known accounts
* remove unused LastWebfingeredAt
* expose test maps on mock http client
* update Update test
* reformat GetAccount() functionality, and add UpdateAccount() function.
* use fetched_at instead of last_webfingered_at
* catch local "not found" errors. small formatting / error string changes
* remove nil error checks (we shouldn't be passing nil errors to newError() initializers)
* remove mutex unlock on transport init fail (it hasn't yet been locked!)
* woops add back the error wrapping to use ErrNotRetrievable
* caches were never being started... :see_no_evil:
---------
Signed-off-by: kim <grufwub@gmail.com>
Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
Diffstat (limited to 'internal/federation/dereference.go')
-rw-r--r-- | internal/federation/dereference.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/internal/federation/dereference.go b/internal/federation/dereference.go deleted file mode 100644 index 5acc038e9..000000000 --- a/internal/federation/dereference.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - GoToSocial - Copyright (C) 2021-2023 GoToSocial Authors admin@gotosocial.org - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -package federation - -import ( - "context" - "net/url" - - "github.com/superseriousbusiness/gotosocial/internal/ap" - "github.com/superseriousbusiness/gotosocial/internal/federation/dereferencing" - "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" -) - -func (f *federator) GetAccount(ctx context.Context, params dereferencing.GetAccountParams) (*gtsmodel.Account, error) { - return f.dereferencer.GetAccount(ctx, params) -} - -func (f *federator) GetStatus(ctx context.Context, username string, remoteStatusID *url.URL, refetch, includeParent bool) (*gtsmodel.Status, ap.Statusable, error) { - return f.dereferencer.GetStatus(ctx, username, remoteStatusID, refetch, includeParent) -} - -func (f *federator) EnrichRemoteStatus(ctx context.Context, username string, status *gtsmodel.Status, includeParent bool) (*gtsmodel.Status, error) { - return f.dereferencer.EnrichRemoteStatus(ctx, username, status, includeParent) -} - -func (f *federator) DereferenceRemoteThread(ctx context.Context, username string, statusIRI *url.URL, status *gtsmodel.Status, statusable ap.Statusable) { - f.dereferencer.DereferenceThread(ctx, username, statusIRI, status, statusable) -} - -func (f *federator) GetRemoteInstance(ctx context.Context, username string, remoteInstanceURI *url.URL) (*gtsmodel.Instance, error) { - return f.dereferencer.GetRemoteInstance(ctx, username, remoteInstanceURI) -} - -func (f *federator) DereferenceAnnounce(ctx context.Context, announce *gtsmodel.Status, requestingUsername string) error { - return f.dereferencer.DereferenceAnnounce(ctx, announce, requestingUsername) -} |