diff options
author | 2024-04-11 11:45:53 +0200 | |
---|---|---|
committer | 2024-04-11 11:45:53 +0200 | |
commit | 9fb8a78f91adffd5f4d28df1270e407c25a7a16e (patch) | |
tree | d68200744e28d07e75a52bb0c9f6593c86a38a91 /internal/db/admin.go | |
parent | [performance] massively improved ActivityPub delivery worker efficiency (#2812) (diff) | |
download | gotosocial-9fb8a78f91adffd5f4d28df1270e407c25a7a16e.tar.xz |
[feature] New user sign-up via web page (#2796)
* [feature] User sign-up form and admin notifs
* add chosen + filtered languages to migration
* remove stray comment
* chosen languages schmosen schmanguages
* proper error on local account missing
Diffstat (limited to 'internal/db/admin.go')
-rw-r--r-- | internal/db/admin.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/db/admin.go b/internal/db/admin.go index fcae928f6..1f24c7932 100644 --- a/internal/db/admin.go +++ b/internal/db/admin.go @@ -19,6 +19,7 @@ package db import ( "context" + "time" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" ) @@ -36,7 +37,7 @@ type Admin interface { // C) something went wrong in the db IsEmailAvailable(ctx context.Context, email string) (bool, error) - // NewSignup creates a new user in the database with the given parameters. + // NewSignup creates a new user + account in the database with the given parameters. // By the time this function is called, it should be assumed that all the parameters have passed validation! NewSignup(ctx context.Context, newSignup gtsmodel.NewSignup) (*gtsmodel.User, error) @@ -50,6 +51,23 @@ type Admin interface { // This is needed for things like serving instance information through /api/v1/instance CreateInstanceInstance(ctx context.Context) error + // CreateInstanceApplication creates an application in the database + // for use in processing signups etc through the sign-up form. + CreateInstanceApplication(ctx context.Context) error + + // GetInstanceApplication gets the instance application + // (ie., the application owned by the instance account). + GetInstanceApplication(ctx context.Context) (*gtsmodel.Application, error) + + // CountApprovedSignupsSince counts the number of new account + // sign-ups approved on this instance since the given time. + CountApprovedSignupsSince(ctx context.Context, since time.Time) (int, error) + + // CountUnhandledSignups counts the number of account sign-ups + // that have not yet been approved or denied. In other words, + // the number of pending sign-ups sitting in the backlog. + CountUnhandledSignups(ctx context.Context) (int, error) + /* ACTION FUNCS */ |