mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 14:17:29 -06:00
tidy up some federation stuff
This commit is contained in:
parent
621e59fd42
commit
211c43073f
11 changed files with 199 additions and 86 deletions
|
|
@ -24,21 +24,14 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/transport"
|
||||
)
|
||||
|
||||
// New returns a go-fed compatible federating actor
|
||||
func New(db db.DB, config *config.Config, log *logrus.Logger) pub.FederatingActor {
|
||||
|
||||
c := &Commoner{
|
||||
db: db,
|
||||
log: log,
|
||||
config: config,
|
||||
}
|
||||
|
||||
f := &Federator{
|
||||
db: db,
|
||||
log: log,
|
||||
config: config,
|
||||
}
|
||||
return pub.NewFederatingActor(c, f, db.Federation(), &Clock{})
|
||||
// NewFederatingActor returns a go-fed compatible federating actor
|
||||
func NewFederatingActor(db db.DB, transportController transport.Controller, config *config.Config, log *logrus.Logger) pub.FederatingActor {
|
||||
c := NewCommonBehavior(db, log, config, transportController)
|
||||
f := NewFederatingProtocol(db, log, config, transportController)
|
||||
pubDatabase := db.Federation()
|
||||
clock := &Clock{}
|
||||
return pub.NewFederatingActor(c, f, pubDatabase, clock)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue