mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-23 23:23:32 -06:00
move to ssb gofed fork (#298)
This commit is contained in:
parent
829a934d23
commit
09ef9e639e
799 changed files with 6458 additions and 2475 deletions
|
|
@ -22,8 +22,9 @@ import (
|
|||
"context"
|
||||
"net/url"
|
||||
|
||||
"github.com/go-fed/activity/streams"
|
||||
"github.com/go-fed/activity/streams/vocab"
|
||||
"github.com/superseriousbusiness/activity/streams"
|
||||
"github.com/superseriousbusiness/activity/streams/vocab"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
// InboxContains returns true if the OrderedCollection at 'inbox'
|
||||
|
|
@ -56,3 +57,25 @@ func (f *federatingDB) GetInbox(c context.Context, inboxIRI *url.URL) (inbox voc
|
|||
func (f *federatingDB) SetInbox(c context.Context, inbox vocab.ActivityStreamsOrderedCollectionPage) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// InboxForActor fetches the inbox corresponding to the given actorIRI.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// The library makes this call only after acquiring a lock first.
|
||||
func (f *federatingDB) InboxForActor(c context.Context, actorIRI *url.URL) (inboxIRI *url.URL, err error) {
|
||||
account, err := f.db.GetAccountByURI(c, actorIRI.String())
|
||||
if err != nil {
|
||||
// if there are just no entries for this account yet it's fine, return nil
|
||||
// and go-fed will try to dereference it instead
|
||||
if err == db.ErrNoEntries {
|
||||
return nil, nil
|
||||
}
|
||||
// there's been an actual error...
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// we got it!
|
||||
return url.Parse(account.InboxURI)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue