diff options
author | 2022-09-23 21:27:35 +0200 | |
---|---|---|
committer | 2022-09-23 20:27:35 +0100 | |
commit | 69a193dae543641a2db6823fa6493c02f56fafbd (patch) | |
tree | c1a0c71d64642db12a17c6770642c3e0af859960 /internal/federation/dereferencing/account_test.go | |
parent | [docs] NLnet follow up questions (#846) (diff) | |
download | gotosocial-69a193dae543641a2db6823fa6493c02f56fafbd.tar.xz |
[feature] Allow delivery to sharedInboxes where possible (#847)
* update Activity
* add instance-deliver-to-shared-inboxes setting
* update activity version again
* add SharedInboxURI field to accounts
* serdes for endpoints/sharedInbox
* deliver to sharedInbox if one is available
* update tests
* only assign shared inbox if shared domain
* look for shared inbox if currently nil
* go fmt
* finger to get params.RemoteAccountID if necessary
* make comments clearer
* compare dns more consistently
Diffstat (limited to 'internal/federation/dereferencing/account_test.go')
-rw-r--r-- | internal/federation/dereferencing/account_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/federation/dereferencing/account_test.go b/internal/federation/dereferencing/account_test.go index 77ebb7cac..4f1a83a96 100644 --- a/internal/federation/dereferencing/account_test.go +++ b/internal/federation/dereferencing/account_test.go @@ -101,6 +101,24 @@ func (suite *AccountTestSuite) TestDereferenceLocalAccountAsRemoteURL() { suite.Empty(fetchedAccount.Domain) } +func (suite *AccountTestSuite) TestDereferenceLocalAccountAsRemoteURLNoSharedInboxYet() { + fetchingAccount := suite.testAccounts["local_account_1"] + targetAccount := suite.testAccounts["local_account_2"] + + targetAccount.SharedInboxURI = nil + if _, err := suite.db.UpdateAccount(context.Background(), targetAccount); err != nil { + suite.FailNow(err.Error()) + } + + fetchedAccount, err := suite.dereferencer.GetRemoteAccount(context.Background(), dereferencing.GetRemoteAccountParams{ + RequestingUsername: fetchingAccount.Username, + RemoteAccountID: testrig.URLMustParse(targetAccount.URI), + }) + suite.NoError(err) + suite.NotNil(fetchedAccount) + suite.Empty(fetchedAccount.Domain) +} + func (suite *AccountTestSuite) TestDereferenceLocalAccountAsUsername() { fetchingAccount := suite.testAccounts["local_account_1"] targetAccount := suite.testAccounts["local_account_2"] |