diff options
author | 2024-01-16 17:22:44 +0100 | |
---|---|---|
committer | 2024-01-16 16:22:44 +0000 | |
commit | c36f9ac37b8bbdeb4def7a20ba8ea6d6b7ad12d5 (patch) | |
tree | 9569c022aaf5c4ceaaf5ce433c95d9d90b6402cc /internal/api/model/account.go | |
parent | [chore] Move to codeberg's exif-terminator (#2536) (diff) | |
download | gotosocial-c36f9ac37b8bbdeb4def7a20ba8ea6d6b7ad12d5.tar.xz |
[feature] Account alias / move API + db models (#2518)
* [feature] Account alias / move API + db models
* go fmt
* fix little cherry-pick issues
* update error checking, formatting
* add and use new util functions to simplify alias logic
Diffstat (limited to 'internal/api/model/account.go')
-rw-r--r-- | internal/api/model/account.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/api/model/account.go b/internal/api/model/account.go index a8851ddcb..46b043f80 100644 --- a/internal/api/model/account.go +++ b/internal/api/model/account.go @@ -96,6 +96,9 @@ type Account struct { // Role of the account on this instance. // Omitted for remote accounts. Role *AccountRole `json:"role,omitempty"` + // If set, indicates that this account is currently inactive, and has migrated to the given account. + // Omitted for accounts that haven't moved, and for suspended accounts. + Moved *Account `json:"moved,omitempty"` } // AccountCreateRequest models account creation parameters. @@ -213,6 +216,23 @@ type AccountDeleteRequest struct { Password string `form:"password" json:"password" xml:"password"` } +// AccountMoveRequest models a request to Move an account. +// +// swagger:ignore +type AccountMoveRequest struct { + // Password of the account's user, for confirmation. + Password string `form:"password" json:"password" xml:"password"` + // ActivityPub URI of the account that's being moved to. + MovedToURI string `form:"moved_to_uri" json:"moved_to_uri" xml:"moved_to_uri"` +} + +// AccountAliasRequest models a request +// to set an account's alsoKnownAs URIs. +type AccountAliasRequest struct { + // ActivityPub URIs of any accounts that this one is being aliased to. + AlsoKnownAsURIs []string `form:"also_known_as_uris" json:"also_known_as_uris" xml:"also_known_as_uris"` +} + // AccountRole models the role of an account. // // swagger:model accountRole |