summaryrefslogtreecommitdiff
path: root/internal/media/handler.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2021-08-20 12:26:56 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-20 12:26:56 +0200
commit4920229a3b6e1d7dde536bc9ff766542b05d935c (patch)
treea9423beccec5331c372f01eedf38949dfb171e9e /internal/media/handler.go
parentText/status parsing fixes (#141) (diff)
downloadgotosocial-4920229a3b6e1d7dde536bc9ff766542b05d935c.tar.xz
Database updates (#144)
* start moving some database stuff around * continue moving db stuff around * more fiddling * more updates * and some more * and yet more * i broke SOMETHING but what, it's a mystery * tidy up * vendor ttlcache * use ttlcache * fix up some tests * rename some stuff * little reminder * some more updates
Diffstat (limited to 'internal/media/handler.go')
-rw-r--r--internal/media/handler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/media/handler.go b/internal/media/handler.go
index 0bcf46488..c383a922e 100644
--- a/internal/media/handler.go
+++ b/internal/media/handler.go
@@ -142,7 +142,7 @@ func (mh *mediaHandler) ProcessHeaderOrAvatar(attachment []byte, accountID strin
}
// set it in the database
- if err := mh.db.SetHeaderOrAvatarForAccountID(ma, accountID); err != nil {
+ if err := mh.db.SetAccountHeaderOrAvatar(ma, accountID); err != nil {
return nil, fmt.Errorf("error putting %s in database: %s", mediaType, err)
}
@@ -231,8 +231,8 @@ func (mh *mediaHandler) ProcessLocalEmoji(emojiBytes []byte, shortcode string) (
// since emoji aren't 'owned' by an account, but we still want to use the same pattern for serving them through the filserver,
// (ie., fileserver/ACCOUNT_ID/etc etc) we need to fetch the INSTANCE ACCOUNT from the database. That is, the account that's created
// with the same username as the instance hostname, which doesn't belong to any particular user.
- instanceAccount := &gtsmodel.Account{}
- if err := mh.db.GetLocalAccountByUsername(mh.config.Host, instanceAccount); err != nil {
+ instanceAccount, err := mh.db.GetInstanceAccount("")
+ if err != nil {
return nil, fmt.Errorf("error fetching instance account: %s", err)
}