mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-05 16:33:16 -06:00
changing more stuff
This commit is contained in:
parent
29b4adfb69
commit
0f7cfa75f3
126 changed files with 1060 additions and 920 deletions
|
|
@ -65,7 +65,7 @@ var Create cliactions.GTSAction = func(ctx context.Context, c *config.Config, lo
|
|||
return err
|
||||
}
|
||||
|
||||
_, err = dbConn.NewSignup(username, "", false, email, password, nil, "", "", false, false)
|
||||
_, err = dbConn.NewSignup(ctx, username, "", false, email, password, nil, "", "", false, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -88,20 +88,20 @@ var Confirm cliactions.GTSAction = func(ctx context.Context, c *config.Config, l
|
|||
return err
|
||||
}
|
||||
|
||||
a, err := dbConn.GetLocalAccountByUsername(username)
|
||||
a, err := dbConn.GetLocalAccountByUsername(ctx, username)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u := >smodel.User{}
|
||||
if err := dbConn.GetWhere([]db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
if err := dbConn.GetWhere(ctx, []db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u.Approved = true
|
||||
u.Email = u.UnconfirmedEmail
|
||||
u.ConfirmedAt = time.Now()
|
||||
if err := dbConn.UpdateByID(u.ID, u); err != nil {
|
||||
if err := dbConn.UpdateByID(ctx, u.ID, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -123,17 +123,17 @@ var Promote cliactions.GTSAction = func(ctx context.Context, c *config.Config, l
|
|||
return err
|
||||
}
|
||||
|
||||
a, err := dbConn.GetLocalAccountByUsername(username)
|
||||
a, err := dbConn.GetLocalAccountByUsername(ctx, username)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u := >smodel.User{}
|
||||
if err := dbConn.GetWhere([]db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
if err := dbConn.GetWhere(ctx, []db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
return err
|
||||
}
|
||||
u.Admin = true
|
||||
if err := dbConn.UpdateByID(u.ID, u); err != nil {
|
||||
if err := dbConn.UpdateByID(ctx, u.ID, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -155,17 +155,17 @@ var Demote cliactions.GTSAction = func(ctx context.Context, c *config.Config, lo
|
|||
return err
|
||||
}
|
||||
|
||||
a, err := dbConn.GetLocalAccountByUsername(username)
|
||||
a, err := dbConn.GetLocalAccountByUsername(ctx, username)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u := >smodel.User{}
|
||||
if err := dbConn.GetWhere([]db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
if err := dbConn.GetWhere(ctx, []db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
return err
|
||||
}
|
||||
u.Admin = false
|
||||
if err := dbConn.UpdateByID(u.ID, u); err != nil {
|
||||
if err := dbConn.UpdateByID(ctx, u.ID, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -187,17 +187,17 @@ var Disable cliactions.GTSAction = func(ctx context.Context, c *config.Config, l
|
|||
return err
|
||||
}
|
||||
|
||||
a, err := dbConn.GetLocalAccountByUsername(username)
|
||||
a, err := dbConn.GetLocalAccountByUsername(ctx, username)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u := >smodel.User{}
|
||||
if err := dbConn.GetWhere([]db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
if err := dbConn.GetWhere(ctx, []db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
return err
|
||||
}
|
||||
u.Disabled = true
|
||||
if err := dbConn.UpdateByID(u.ID, u); err != nil {
|
||||
if err := dbConn.UpdateByID(ctx, u.ID, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -233,13 +233,13 @@ var Password cliactions.GTSAction = func(ctx context.Context, c *config.Config,
|
|||
return err
|
||||
}
|
||||
|
||||
a, err := dbConn.GetLocalAccountByUsername(username)
|
||||
a, err := dbConn.GetLocalAccountByUsername(ctx, username)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
u := >smodel.User{}
|
||||
if err := dbConn.GetWhere([]db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
if err := dbConn.GetWhere(ctx, []db.Where{{Key: "account_id", Value: a.ID}}, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ var Password cliactions.GTSAction = func(ctx context.Context, c *config.Config,
|
|||
|
||||
u.EncryptedPassword = string(pw)
|
||||
|
||||
if err := dbConn.UpdateByID(u.ID, u); err != nil {
|
||||
if err := dbConn.UpdateByID(ctx, u.ID, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,22 +85,22 @@ var Start cliactions.GTSAction = func(ctx context.Context, c *config.Config, log
|
|||
}
|
||||
|
||||
for _, m := range models {
|
||||
if err := dbService.CreateTable(m); err != nil {
|
||||
if err := dbService.CreateTable(ctx, m); err != nil {
|
||||
return fmt.Errorf("table creation error: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := dbService.CreateInstanceAccount(); err != nil {
|
||||
if err := dbService.CreateInstanceAccount(ctx); err != nil {
|
||||
return fmt.Errorf("error creating instance account: %s", err)
|
||||
}
|
||||
|
||||
if err := dbService.CreateInstanceInstance(); err != nil {
|
||||
if err := dbService.CreateInstanceInstance(ctx); err != nil {
|
||||
return fmt.Errorf("error creating instance instance: %s", err)
|
||||
}
|
||||
|
||||
federatingDB := federatingdb.New(dbService, c, log)
|
||||
|
||||
router, err := router.New(c, dbService, log)
|
||||
router, err := router.New(ctx, c, dbService, log)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating router: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue