mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 03:22:24 -05:00
[bugfix] Deref stats async, serve stub collections if handshaking (#2990)
* [bugfix] Deref stats async, allow peek if handshaking * don't return totalItems when handshaking or hiding collections * use GetLimit() * use StubAccountStats
This commit is contained in:
parent
fd6637df4a
commit
611f9de39b
14 changed files with 412 additions and 261 deletions
|
|
@ -120,16 +120,6 @@ func (a *adminDB) NewSignup(ctx context.Context, newSignup gtsmodel.NewSignup) (
|
|||
return nil, err
|
||||
}
|
||||
|
||||
settings := >smodel.AccountSettings{
|
||||
AccountID: accountID,
|
||||
Privacy: gtsmodel.VisibilityDefault,
|
||||
}
|
||||
|
||||
// Insert the settings!
|
||||
if err := a.state.DB.PutAccountSettings(ctx, settings); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
account = >smodel.Account{
|
||||
ID: accountID,
|
||||
Username: newSignup.Username,
|
||||
|
|
@ -145,13 +135,26 @@ func (a *adminDB) NewSignup(ctx context.Context, newSignup gtsmodel.NewSignup) (
|
|||
PrivateKey: privKey,
|
||||
PublicKey: &privKey.PublicKey,
|
||||
PublicKeyURI: uris.PublicKeyURI,
|
||||
Settings: settings,
|
||||
}
|
||||
|
||||
// Insert the new account!
|
||||
if err := a.state.DB.PutAccount(ctx, account); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Insert basic settings for new account.
|
||||
account.Settings = >smodel.AccountSettings{
|
||||
AccountID: accountID,
|
||||
Privacy: gtsmodel.VisibilityDefault,
|
||||
}
|
||||
if err := a.state.DB.PutAccountSettings(ctx, account.Settings); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Stub empty stats for new account.
|
||||
if err := a.state.DB.StubAccountStats(ctx, account); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Created or already had an account.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue