// Account represents either a local or a remote fediverse account, gotosocial or otherwise (mastodon, pleroma, etc).
typeAccountstruct{
IDstring`bun:"type:CHAR(26),pk,nullzero,notnull,unique"`// id of this item in the database
CreatedAttime.Time`bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"`// when was item created.
UpdatedAttime.Time`bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"`// when was item was last updated.
FetchedAttime.Time`bun:"type:timestamptz,nullzero"`// when was item (remote) last fetched.
Usernamestring`bun:",nullzero,notnull,unique:usernamedomain"`// Username of the account, should just be a string of [a-zA-Z0-9_]. Can be added to domain to create the full username in the form ``[username]@[domain]`` eg., ``user_96@example.org``. Username and domain should be unique *with* each other
Domainstring`bun:",nullzero,unique:usernamedomain"`// Domain of the account, will be null if this is a local account, otherwise something like ``example.org``. Should be unique with username.
AvatarMediaAttachmentIDstring`bun:"type:CHAR(26),nullzero"`// Database ID of the media attachment, if present
AvatarMediaAttachment*MediaAttachment`bun:"rel:belongs-to"`// MediaAttachment corresponding to avatarMediaAttachmentID
AvatarRemoteURLstring`bun:",nullzero"`// For a non-local account, where can the header be fetched?
HeaderMediaAttachmentIDstring`bun:"type:CHAR(26),nullzero"`// Database ID of the media attachment, if present
HeaderMediaAttachment*MediaAttachment`bun:"rel:belongs-to"`// MediaAttachment corresponding to headerMediaAttachmentID
HeaderRemoteURLstring`bun:",nullzero"`// For a non-local account, where can the header be fetched?
DisplayNamestring`bun:""`// DisplayName for this account. Can be empty, then just the Username will be used for display purposes.
EmojiIDs[]string`bun:"emojis,array"`// Database IDs of any emojis used in this account's bio, display name, etc
Emojis[]*Emoji`bun:"attached_emojis,m2m:account_to_emojis"`// Emojis corresponding to emojiIDs. https://bun.uptrace.dev/guide/relations.html#many-to-many-relation
Fields[]*Field// A slice of of fields that this account has added to their profile.
FieldsRaw[]*Field// The raw (unparsed) content of fields that this account has added to their profile, without conversion to HTML, only available when requester = target
Notestring`bun:""`// A note that this account has on their profile (ie., the account's bio/description of themselves)
NoteRawstring`bun:""`// The raw contents of .Note without conversion to HTML, only available when requester = target
Memorial*bool`bun:",default:false"`// Is this a memorial account, ie., has the user passed away?
AlsoKnownAsstring`bun:"type:CHAR(26),nullzero"`// This account is associated with x account id (TODO: migrate to be AlsoKnownAsID)
MovedToAccountIDstring`bun:"type:CHAR(26),nullzero"`// This account has moved this account id in the database
Bot*bool`bun:",default:false"`// Does this account identify itself as a bot?
Reasonstring`bun:""`// What reason was given for signing up when this account was created?
Locked*bool`bun:",default:true"`// Does this account need an approval for new followers?
Discoverable*bool`bun:",default:false"`// Should this account be shown in the instance's profile directory?
PrivacyVisibility`bun:",nullzero"`// Default post privacy for this account
Sensitive*bool`bun:",default:false"`// Set posts from this account to sensitive by default?
Languagestring`bun:",nullzero,notnull,default:'en'"`// What language does this account post in?
StatusContentTypestring`bun:",nullzero"`// What is the default format for statuses posted by this account (only for local accounts).
CustomCSSstring`bun:",nullzero"`// Custom CSS that should be displayed for this Account's profile and statuses.
URIstring`bun:",nullzero,notnull,unique"`// ActivityPub URI for this account.
URLstring`bun:",nullzero,unique"`// Web URL for this account's profile
InboxURIstring`bun:",nullzero,unique"`// Address of this account's ActivityPub inbox, for sending activity to
SharedInboxURI*string`bun:""`// Address of this account's ActivityPub sharedInbox. Gotcha warning: this is a string pointer because it has three possible states: 1. We don't know yet if the account has a shared inbox -- null. 2. We know it doesn't have a shared inbox -- empty string. 3. We know it does have a shared inbox -- url string.
OutboxURIstring`bun:",nullzero,unique"`// Address of this account's activitypub outbox
FollowingURIstring`bun:",nullzero,unique"`// URI for getting the following list of this account
FollowersURIstring`bun:",nullzero,unique"`// URI for getting the followers list of this account
FeaturedCollectionURIstring`bun:",nullzero,unique"`// URL for getting the featured collection list of this account
ActorTypestring`bun:",nullzero,notnull"`// What type of activitypub actor is this account?
PrivateKey*rsa.PrivateKey`bun:""`// Privatekey for validating activitypub requests, will only be defined for local accounts
PublicKey*rsa.PublicKey`bun:",notnull"`// Publickey for encoding activitypub requests, will be defined for both local and remote accounts
PublicKeyURIstring`bun:",nullzero,notnull,unique"`// Web-reachable location of this account's public key
SensitizedAttime.Time`bun:"type:timestamptz,nullzero"`// When was this account set to have all its media shown as sensitive?
SilencedAttime.Time`bun:"type:timestamptz,nullzero"`// When was this account silenced (eg., statuses only visible to followers, not public)?
SuspendedAttime.Time`bun:"type:timestamptz,nullzero"`// When was this account suspended (eg., don't allow it to log in/post, don't accept media/posts from this account)
HideCollections*bool`bun:",default:false"`// Hide this account's collections
SuspensionOriginstring`bun:"type:CHAR(26),nullzero"`// id of the database entry that caused this account to become suspended -- can be an account ID or a domain block ID
EnableRSS*bool`bun:",default:false"`// enable RSS feed subscription for this account's public posts at [URL]/feed
IDstring`bun:"type:CHAR(26),pk,nullzero,notnull,unique"`// id of this item in the database
CreatedAttime.Time`bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"`// when was item created.
UpdatedAttime.Time`bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"`// when was item was last updated.
FetchedAttime.Time`bun:"type:timestamptz,nullzero"`// when was item (remote) last fetched.
Usernamestring`bun:",nullzero,notnull,unique:usernamedomain"`// Username of the account, should just be a string of [a-zA-Z0-9_]. Can be added to domain to create the full username in the form ``[username]@[domain]`` eg., ``user_96@example.org``. Username and domain should be unique *with* each other
Domainstring`bun:",nullzero,unique:usernamedomain"`// Domain of the account, will be null if this is a local account, otherwise something like ``example.org``. Should be unique with username.
AvatarMediaAttachmentIDstring`bun:"type:CHAR(26),nullzero"`// Database ID of the media attachment, if present
AvatarMediaAttachment*MediaAttachment`bun:"rel:belongs-to"`// MediaAttachment corresponding to avatarMediaAttachmentID
AvatarRemoteURLstring`bun:",nullzero"`// For a non-local account, where can the header be fetched?
HeaderMediaAttachmentIDstring`bun:"type:CHAR(26),nullzero"`// Database ID of the media attachment, if present
HeaderMediaAttachment*MediaAttachment`bun:"rel:belongs-to"`// MediaAttachment corresponding to headerMediaAttachmentID
HeaderRemoteURLstring`bun:",nullzero"`// For a non-local account, where can the header be fetched?
DisplayNamestring`bun:""`// DisplayName for this account. Can be empty, then just the Username will be used for display purposes.
EmojiIDs[]string`bun:"emojis,array"`// Database IDs of any emojis used in this account's bio, display name, etc
Emojis[]*Emoji`bun:"attached_emojis,m2m:account_to_emojis"`// Emojis corresponding to emojiIDs. https://bun.uptrace.dev/guide/relations.html#many-to-many-relation
Fields[]*Field`bun:""`// A slice of of fields that this account has added to their profile.
FieldsRaw[]*Field`bun:""`// The raw (unparsed) content of fields that this account has added to their profile, without conversion to HTML, only available when requester = target
Notestring`bun:""`// A note that this account has on their profile (ie., the account's bio/description of themselves)
NoteRawstring`bun:""`// The raw contents of .Note without conversion to HTML, only available when requester = target
Memorial*bool`bun:",default:false"`// Is this a memorial account, ie., has the user passed away?
AlsoKnownAsstring`bun:"type:CHAR(26),nullzero"`// This account is associated with x account id (TODO: migrate to be AlsoKnownAsID)
MovedToAccountIDstring`bun:"type:CHAR(26),nullzero"`// This account has moved this account id in the database
Bot*bool`bun:",default:false"`// Does this account identify itself as a bot?
Reasonstring`bun:""`// What reason was given for signing up when this account was created?
Locked*bool`bun:",default:true"`// Does this account need an approval for new followers?
Discoverable*bool`bun:",default:false"`// Should this account be shown in the instance's profile directory?
URIstring`bun:",nullzero,notnull,unique"`// ActivityPub URI for this account.
URLstring`bun:",nullzero,unique"`// Web URL for this account's profile
InboxURIstring`bun:",nullzero,unique"`// Address of this account's ActivityPub inbox, for sending activity to
SharedInboxURI*string`bun:""`// Address of this account's ActivityPub sharedInbox. Gotcha warning: this is a string pointer because it has three possible states: 1. We don't know yet if the account has a shared inbox -- null. 2. We know it doesn't have a shared inbox -- empty string. 3. We know it does have a shared inbox -- url string.
OutboxURIstring`bun:",nullzero,unique"`// Address of this account's activitypub outbox
FollowingURIstring`bun:",nullzero,unique"`// URI for getting the following list of this account
FollowersURIstring`bun:",nullzero,unique"`// URI for getting the followers list of this account
FeaturedCollectionURIstring`bun:",nullzero,unique"`// URL for getting the featured collection list of this account
ActorTypestring`bun:",nullzero,notnull"`// What type of activitypub actor is this account?
PrivateKey*rsa.PrivateKey`bun:""`// Privatekey for validating activitypub requests, will only be defined for local accounts
PublicKey*rsa.PublicKey`bun:",notnull"`// Publickey for encoding activitypub requests, will be defined for both local and remote accounts
PublicKeyURIstring`bun:",nullzero,notnull,unique"`// Web-reachable location of this account's public key
SensitizedAttime.Time`bun:"type:timestamptz,nullzero"`// When was this account set to have all its media shown as sensitive?
SilencedAttime.Time`bun:"type:timestamptz,nullzero"`// When was this account silenced (eg., statuses only visible to followers, not public)?
SuspendedAttime.Time`bun:"type:timestamptz,nullzero"`// When was this account suspended (eg., don't allow it to log in/post, don't accept media/posts from this account)
SuspensionOriginstring`bun:"type:CHAR(26),nullzero"`// id of the database entry that caused this account to become suspended -- can be an account ID or a domain block ID
PreferencesIDstring`bun:"type:CHAR(26),nullzero"`// ID of the LocalAccountPreferences entry for this account. Only set for local accounts.
Preferences*AccountPreferences`bun:"-"`// Preferences corresponding to PreferencesID. Local accounts only.
}
// IsLocal returns whether account is a local user account.