aboutsummaryrefslogtreecommitdiff
path: root/db/database.go
diff options
context:
space:
mode:
authorFChannel <>2022-06-05 15:14:34 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit3ac22385f2cb2256db718e47f5ae3c6d13353b70 (patch)
tree49f12c0cc52661f1fd6661baf2f77fbd5c7f71de /db/database.go
parent0359d9d410b9ab597ed4a067d767ab59472b0c03 (diff)
added janny managment for admin board pages
Diffstat (limited to 'db/database.go')
-rw-r--r--db/database.go49
1 files changed, 14 insertions, 35 deletions
diff --git a/db/database.go b/db/database.go
index c6c2fc7..2c42cf5 100644
--- a/db/database.go
+++ b/db/database.go
@@ -85,45 +85,24 @@ func CreateNewBoard(actor activitypub.Actor) (activitypub.Actor, error) {
}
}
- var verify util.Verify
+ {
+ var verify util.Verify
+ verify.Type = "admin"
+ verify.Identifier = actor.Id
- verify.Type = "admin"
- verify.Identifier = actor.Id
-
- if verify.Code, err = util.CreateKey(50); err != nil {
- return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
- }
-
- if err := verify.Create(); err != nil {
- return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
- }
-
- verify.Type = "janitor"
- verify.Identifier = actor.Id
-
- if verify.Code, err = util.CreateKey(50); err != nil {
- return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
- }
-
- if err := verify.Create(); err != nil {
- return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
- }
-
- var nverify util.Verify
- nverify.Board = actor.Id
- nverify.Identifier = "admin"
- nverify.Type = "admin"
-
- if err := nverify.CreateBoardMod(); err != nil {
- return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
+ if err := actor.CreateVerification(verify); err != nil {
+ return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
+ }
}
- nverify.Board = actor.Id
- nverify.Identifier = "janitor"
- nverify.Type = "janitor"
+ {
+ var verify util.Verify
+ verify.Type = "janitor"
+ verify.Identifier = actor.Id
- if err := nverify.CreateBoardMod(); err != nil {
- return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
+ if err := actor.CreateVerification(verify); err != nil {
+ return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB")
+ }
}
activitypub.CreatePem(actor)