summaryrefslogtreecommitdiff
path: root/internal/processing/account/get.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account/get.go')
-rw-r--r--internal/processing/account/get.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/processing/account/get.go b/internal/processing/account/get.go
index c558b52ed..7d373bc8c 100644
--- a/internal/processing/account/get.go
+++ b/internal/processing/account/get.go
@@ -55,6 +55,18 @@ func (p *processor) GetLocalByUsername(ctx context.Context, requestingAccount *g
return p.getAccountFor(ctx, requestingAccount, targetAccount)
}
+func (p *processor) GetCustomCSSForUsername(ctx context.Context, username string) (string, gtserror.WithCode) {
+ customCSS, err := p.db.GetAccountCustomCSSByUsername(ctx, username)
+ if err != nil {
+ if err == db.ErrNoEntries {
+ return "", gtserror.NewErrorNotFound(errors.New("account not found"))
+ }
+ return "", gtserror.NewErrorInternalError(fmt.Errorf("db error: %s", err))
+ }
+
+ return customCSS, nil
+}
+
func (p *processor) getAccountFor(ctx context.Context, requestingAccount *gtsmodel.Account, targetAccount *gtsmodel.Account) (*apimodel.Account, gtserror.WithCode) {
var blocked bool
var err error