diff options
Diffstat (limited to 'internal/typeutils/astointernal.go')
-rw-r--r-- | internal/typeutils/astointernal.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/typeutils/astointernal.go b/internal/typeutils/astointernal.go index 7ec45335d..b69bb247e 100644 --- a/internal/typeutils/astointernal.go +++ b/internal/typeutils/astointernal.go @@ -23,6 +23,7 @@ import ( "errors" "fmt" + "github.com/miekg/dns" "github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" @@ -156,6 +157,19 @@ func (c *converter) ASRepresentationToAccount(ctx context.Context, accountable a acct.InboxURI = accountable.GetActivityStreamsInbox().GetIRI().String() } + // SharedInboxURI + if sharedInboxURI := ap.ExtractSharedInbox(accountable); sharedInboxURI != nil { + var sharedInbox string + + // only trust shared inbox if it has at least two domains, + // from the right, in common with the domain of the account + if dns.CompareDomainName(acct.Domain, sharedInboxURI.Host) >= 2 { + sharedInbox = sharedInboxURI.String() + } + + acct.SharedInboxURI = &sharedInbox + } + // OutboxURI if accountable.GetActivityStreamsOutbox() != nil && accountable.GetActivityStreamsOutbox().GetIRI() != nil { acct.OutboxURI = accountable.GetActivityStreamsOutbox().GetIRI().String() |