mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:12:25 -05:00
[bugfix] Missing emoji urls (#3707)
* filter out emoji that are uncached when converting to frontend models * some very small fixups * remove TODO notice
This commit is contained in:
parent
1ab960bf15
commit
91cef3495d
4 changed files with 32 additions and 11 deletions
|
|
@ -31,7 +31,8 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
)
|
||||
|
||||
// Account represents either a local or a remote fediverse account, gotosocial or otherwise (mastodon, pleroma, etc).
|
||||
// Account represents either a local or a remote fediverse
|
||||
// account, gotosocial or otherwise (mastodon, pleroma, etc).
|
||||
type Account struct {
|
||||
ID string `bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
|
||||
CreatedAt time.Time `bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item created.
|
||||
|
|
@ -83,9 +84,19 @@ type Account struct {
|
|||
Stats *AccountStats `bun:"-"` // gtsmodel.AccountStats for this account.
|
||||
}
|
||||
|
||||
// UsernameDomain returns account @username@domain (missing domain if local).
|
||||
func (a *Account) UsernameDomain() string {
|
||||
if a.IsLocal() {
|
||||
return "@" + a.Username
|
||||
}
|
||||
return "@" + a.Username + "@" + a.Domain
|
||||
}
|
||||
|
||||
// IsLocal returns whether account is a local user account.
|
||||
func (a *Account) IsLocal() bool {
|
||||
return a.Domain == "" || a.Domain == config.GetHost() || a.Domain == config.GetAccountDomain()
|
||||
return a.Domain == "" ||
|
||||
a.Domain == config.GetHost() ||
|
||||
a.Domain == config.GetAccountDomain()
|
||||
}
|
||||
|
||||
// IsRemote returns whether account is a remote user account.
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ package gtsmodel
|
|||
|
||||
import "time"
|
||||
|
||||
// Emoji represents a custom emoji that's been uploaded through the admin UI or downloaded from a remote instance.
|
||||
// Emoji represents a custom emoji that's been uploaded
|
||||
// through the admin UI or downloaded from a remote instance.
|
||||
type Emoji struct {
|
||||
ID string `bun:"type:CHAR(26),pk,nullzero,notnull,unique"` // id of this item in the database
|
||||
CreatedAt time.Time `bun:"type:timestamptz,nullzero,notnull,default:current_timestamp"` // when was item created
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue