mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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
This commit is contained in:
@@ -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"]
|
||||
|
Reference in New Issue
Block a user