summaryrefslogtreecommitdiff
path: root/vendor
diff options
context:
space:
mode:
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/superseriousbusiness/activity/pub/database.go18
-rw-r--r--vendor/github.com/superseriousbusiness/activity/pub/side_effect_actor.go19
-rw-r--r--vendor/modules.txt6
3 files changed, 24 insertions, 19 deletions
diff --git a/vendor/github.com/superseriousbusiness/activity/pub/database.go b/vendor/github.com/superseriousbusiness/activity/pub/database.go
index 1abf98b0d..8d3bbd465 100644
--- a/vendor/github.com/superseriousbusiness/activity/pub/database.go
+++ b/vendor/github.com/superseriousbusiness/activity/pub/database.go
@@ -59,13 +59,23 @@ type Database interface {
//
// The library makes this call only after acquiring a lock first.
OutboxForInbox(c context.Context, inboxIRI *url.URL) (outboxIRI *url.URL, err error)
- // InboxForActor fetches the inbox corresponding to the given actorIRI.
+ // InboxesForIRI fetches inboxes corresponding to the given iri.
+ // This allows your server to skip remote dereferencing of iris
+ // in order to speed up message delivery, if desired.
//
- // It is acceptable to just return nil for the inboxIRI. In this case, the library will
- // attempt to resolve the inbox of the actor by remote dereferencing instead.
+ // It is acceptable to just return nil or an empty slice for the inboxIRIs,
+ // if you don't know the inbox iri, or you don't wish to use this feature.
+ // In this case, the library will attempt to resolve inboxes of the iri
+ // by remote dereferencing instead.
+ //
+ // If the input iri is the iri of an Actor, then the inbox for the actor
+ // should be returned as a single-entry slice.
+ //
+ // If the input iri is a Collection (such as a Collection of followers),
+ // then each follower inbox IRI should be returned in the inboxIRIs slice.
//
// The library makes this call only after acquiring a lock first.
- InboxForActor(c context.Context, actorIRI *url.URL) (inboxIRI *url.URL, err error)
+ InboxesForIRI(c context.Context, iri *url.URL) (inboxIRIs []*url.URL, err error)
// Exists returns true if the database has an entry for the specified
// id. It may not be owned by this application instance.
//
diff --git a/vendor/github.com/superseriousbusiness/activity/pub/side_effect_actor.go b/vendor/github.com/superseriousbusiness/activity/pub/side_effect_actor.go
index c58907e3b..73b6c8a74 100644
--- a/vendor/github.com/superseriousbusiness/activity/pub/side_effect_actor.go
+++ b/vendor/github.com/superseriousbusiness/activity/pub/side_effect_actor.go
@@ -681,7 +681,6 @@ func (a *sideEffectActor) prepare(c context.Context, outboxIRI *url.URL, activit
// first check if the implemented database logic can return any inboxes
// from our list of actor IRIs.
foundInboxesFromDB := []*url.URL{}
- foundActorsFromDB := []*url.URL{}
for _, actorIRI := range r {
// BEGIN LOCK
err = a.db.Lock(c, actorIRI)
@@ -689,16 +688,20 @@ func (a *sideEffectActor) prepare(c context.Context, outboxIRI *url.URL, activit
return
}
- inbox, err := a.db.InboxForActor(c, actorIRI)
+ inboxes, err := a.db.InboxesForIRI(c, actorIRI)
if err != nil {
// bail on error
a.db.Unlock(c, actorIRI)
return nil, err
}
- if inbox != nil {
+
+ if len(inboxes) > 0 {
// we have a hit
- foundInboxesFromDB = append(foundInboxesFromDB, inbox)
- foundActorsFromDB = append(foundActorsFromDB, actorIRI)
+ foundInboxesFromDB = append(foundInboxesFromDB, inboxes...)
+
+ // if we found inboxes for this iri, we should remove it from
+ // the list of actors/iris we still need to dereference
+ r = removeOne(r, actorIRI)
}
// END LOCK
@@ -708,12 +711,6 @@ func (a *sideEffectActor) prepare(c context.Context, outboxIRI *url.URL, activit
}
}
- // for every actor we found an inbox for in the db, we should
- // remove it from the list of actors we still need to dereference
- for _, actorIRI := range foundActorsFromDB {
- r = removeOne(r, actorIRI)
- }
-
// look for any actors' inboxes that weren't already discovered above;
// find these by making dereference calls to remote instances
t, err := a.common.NewTransport(c, outboxIRI, goFedUserAgent())
diff --git a/vendor/modules.txt b/vendor/modules.txt
index cca94fc56..4a250d0eb 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -120,8 +120,6 @@ github.com/golang/geo/r2
github.com/golang/geo/r3
github.com/golang/geo/s1
github.com/golang/geo/s2
-# github.com/golang/mock v1.6.0
-## explicit; go 1.11
# github.com/golang/protobuf v1.5.2
## explicit; go 1.9
github.com/golang/protobuf/proto
@@ -286,8 +284,8 @@ github.com/stretchr/testify/suite
# github.com/subosito/gotenv v1.2.0
## explicit
github.com/subosito/gotenv
-# github.com/superseriousbusiness/activity v1.0.1-0.20211113133524-56560b73ace8
-## explicit; go 1.12
+# github.com/superseriousbusiness/activity v1.0.1-0.20220405135100-18e8f86a760a
+## explicit; go 1.18
github.com/superseriousbusiness/activity/pub
github.com/superseriousbusiness/activity/streams
github.com/superseriousbusiness/activity/streams/impl/activitystreams/property_accuracy