summaryrefslogtreecommitdiff
path: root/internal/transport/controller.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/transport/controller.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/transport/controller.go')
-rw-r--r--internal/transport/controller.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/transport/controller.go b/internal/transport/controller.go
index 33eab2a3a..4eb6b5658 100644
--- a/internal/transport/controller.go
+++ b/internal/transport/controller.go
@@ -28,7 +28,6 @@ import (
"github.com/sirupsen/logrus"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
- "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
)
// Controller generates transports for use in making federation requests to other servers.
@@ -95,14 +94,15 @@ func (c *controller) NewTransportForUsername(username string) (Transport, error)
// We need an account to use to create a transport for dereferecing something.
// If a username has been given, we can fetch the account with that username and use it.
// Otherwise, we can take the instance account and use those credentials to make the request.
- ourAccount := &gtsmodel.Account{}
var u string
if username == "" {
u = c.config.Host
} else {
u = username
}
- if err := c.db.GetLocalAccountByUsername(u, ourAccount); err != nil {
+
+ ourAccount, err := c.db.GetLocalAccountByUsername(u)
+ if err != nil {
return nil, fmt.Errorf("error getting account %s from db: %s", username, err)
}