[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:
tobi 2022-09-23 21:27:35 +02:00 committed by GitHub
commit 69a193dae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 2212 additions and 32 deletions

View file

@ -20,6 +20,7 @@ import (
propertydeleted "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_deleted"
propertydescribes "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_describes"
propertyduration "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_duration"
propertyendpoints "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_endpoints"
propertyendtime "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_endtime"
propertyfirst "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_first"
propertyfollowers "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_followers"
@ -61,6 +62,7 @@ import (
propertyreplies "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_replies"
propertyresult "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_result"
propertysensitive "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_sensitive"
propertysharedinbox "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_sharedinbox"
propertyshares "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_shares"
propertysource "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_source"
propertystartindex "github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_startindex"
@ -91,6 +93,7 @@ import (
typedelete "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_delete"
typedislike "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_dislike"
typedocument "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_document"
typeendpoints "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_endpoints"
typeevent "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_event"
typeflag "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_flag"
typefollow "github.com/superseriousbusiness/activity/streams/impl/activitystreams/type_follow"
@ -784,6 +787,32 @@ func (this Manager) DeserializeEndTimePropertyActivityStreams() func(map[string]
}
}
// DeserializeEndpointsActivityStreams returns the deserialization method for the
// "ActivityStreamsEndpoints" non-functional property in the vocabulary
// "ActivityStreams"
func (this Manager) DeserializeEndpointsActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndpoints, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.ActivityStreamsEndpoints, error) {
i, err := typeendpoints.DeserializeEndpoints(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeEndpointsPropertyActivityStreams returns the deserialization method
// for the "ActivityStreamsEndpointsProperty" non-functional property in the
// vocabulary "ActivityStreams"
func (this Manager) DeserializeEndpointsPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsEndpointsProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.ActivityStreamsEndpointsProperty, error) {
i, err := propertyendpoints.DeserializeEndpointsProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeEventActivityStreams returns the deserialization method for the
// "ActivityStreamsEvent" non-functional property in the vocabulary
// "ActivityStreams"
@ -1908,6 +1937,19 @@ func (this Manager) DeserializeServiceActivityStreams() func(map[string]interfac
}
}
// DeserializeSharedInboxPropertyActivityStreams returns the deserialization
// method for the "ActivityStreamsSharedInboxProperty" non-functional property
// in the vocabulary "ActivityStreams"
func (this Manager) DeserializeSharedInboxPropertyActivityStreams() func(map[string]interface{}, map[string]string) (vocab.ActivityStreamsSharedInboxProperty, error) {
return func(m map[string]interface{}, aliasMap map[string]string) (vocab.ActivityStreamsSharedInboxProperty, error) {
i, err := propertysharedinbox.DeserializeSharedInboxProperty(m, aliasMap)
if i == nil {
return nil, err
}
return i, err
}
}
// DeserializeSharesPropertyActivityStreams returns the deserialization method for
// the "ActivityStreamsSharesProperty" non-functional property in the
// vocabulary "ActivityStreams"