diff options
author | 2024-03-22 14:03:46 +0100 | |
---|---|---|
committer | 2024-03-22 14:03:46 +0100 | |
commit | 7f4a0a1aeb8a294ee967c63d7a48446df013ec44 (patch) | |
tree | b9b3836fa0abe1d7a5758d07d6ebb6486a353d56 /internal/trans/import.go | |
parent | [bugfix] add all possible busy result codes to the sqlite errBusy catching ch... (diff) | |
download | gotosocial-7f4a0a1aeb8a294ee967c63d7a48446df013ec44.tar.xz |
[chore] Move local account settings to separate db table (#2770)
* [chore] Move local account settings to separate database model
* don't use separate settings_id
Diffstat (limited to 'internal/trans/import.go')
-rw-r--r-- | internal/trans/import.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/trans/import.go b/internal/trans/import.go index 0fd539114..c77b439f5 100644 --- a/internal/trans/import.go +++ b/internal/trans/import.go @@ -25,6 +25,7 @@ import ( "io" "os" + "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/log" transmodel "github.com/superseriousbusiness/gotosocial/internal/trans/model" ) @@ -73,6 +74,14 @@ func (i *importer) inputEntry(ctx context.Context, entry transmodel.Entry) error if err := i.putInDB(ctx, account); err != nil { return fmt.Errorf("inputEntry: error adding account to database: %s", err) } + if account.Domain == "" && account.Username != config.GetHost() { + // Local, non-instance account. + // Insert barebones settings model. + settings := &transmodel.AccountSettings{AccountID: account.ID} + if err := i.putInDB(ctx, settings); err != nil { + return fmt.Errorf("inputEntry: error adding account settings to database: %s", err) + } + } log.Infof(ctx, "added account with id %s", account.ID) return nil case transmodel.TransBlock: |