[feature] Store admin actions in the db, prevent conflicting actions (#2167)

This commit is contained in:
tobi
2023-09-04 15:55:17 +02:00
committed by GitHub
parent 4f3daeebcb
commit 3ed1ca68e5
23 changed files with 1393 additions and 272 deletions

View File

@ -20,6 +20,7 @@ package admin
import (
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
"github.com/superseriousbusiness/gotosocial/internal/email"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/media"
"github.com/superseriousbusiness/gotosocial/internal/state"
"github.com/superseriousbusiness/gotosocial/internal/transport"
@ -33,6 +34,14 @@ type Processor struct {
mediaManager *media.Manager
transportController transport.Controller
emailSender email.Sender
// admin Actions currently
// undergoing processing
actions *Actions
}
func (p *Processor) Actions() *Actions {
return p.actions
}
// New returns a new admin processor.
@ -44,5 +53,10 @@ func New(state *state.State, tc typeutils.TypeConverter, mediaManager *media.Man
mediaManager: mediaManager,
transportController: transportController,
emailSender: emailSender,
actions: &Actions{
r: make(map[string]*gtsmodel.AdminAction),
state: state,
},
}
}