mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Make lint and tests happy
This commit is contained in:
parent
bf8211b654
commit
6f6a1d32c3
|
|
@ -500,6 +500,14 @@ type testUserAPI struct {
|
||||||
accessTokens map[string]userapi.Device
|
accessTokens map[string]userapi.Device
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *testUserAPI) InputPresenceData(ctx context.Context, req *userapi.InputPresenceRequest, res *userapi.InputPresenceResponse) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *testUserAPI) QueryPresenceForUser(ctx context.Context, req *userapi.QueryPresenceForUserRequest, res *userapi.QueryPresenceForUserResponse) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (u *testUserAPI) InputAccountData(ctx context.Context, req *userapi.InputAccountDataRequest, res *userapi.InputAccountDataResponse) error {
|
func (u *testUserAPI) InputAccountData(ctx context.Context, req *userapi.InputAccountDataRequest, res *userapi.InputAccountDataResponse) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,14 @@ type testUserAPI struct {
|
||||||
accessTokens map[string]userapi.Device
|
accessTokens map[string]userapi.Device
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *testUserAPI) InputPresenceData(ctx context.Context, req *userapi.InputPresenceRequest, res *userapi.InputPresenceResponse) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *testUserAPI) QueryPresenceForUser(ctx context.Context, req *userapi.QueryPresenceForUserRequest, res *userapi.QueryPresenceForUserResponse) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (u *testUserAPI) InputAccountData(ctx context.Context, req *userapi.InputAccountDataRequest, res *userapi.InputAccountDataResponse) error {
|
func (u *testUserAPI) InputAccountData(ctx context.Context, req *userapi.InputAccountDataRequest, res *userapi.InputAccountDataResponse) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,8 @@ func (a *UserInternalAPI) QueryPresenceForUser(ctx context.Context, req *api.Que
|
||||||
var maxLastSeen int64
|
var maxLastSeen int64
|
||||||
// If it's a local user, we can check the devices for possible updated timestamps
|
// If it's a local user, we can check the devices for possible updated timestamps
|
||||||
if domain == a.ServerName {
|
if domain == a.ServerName {
|
||||||
devs, err := a.DeviceDB.GetDevicesByLocalpart(ctx, local)
|
var devs []api.Device
|
||||||
|
devs, err = a.DeviceDB.GetDevicesByLocalpart(ctx, local)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ const selectPresenceForUserSQL = "" +
|
||||||
" WHERE user_id = $1 LIMIT 1"
|
" WHERE user_id = $1 LIMIT 1"
|
||||||
|
|
||||||
type presenceStatements struct {
|
type presenceStatements struct {
|
||||||
db *sql.DB
|
|
||||||
upsertPresenceStmt *sql.Stmt
|
upsertPresenceStmt *sql.Stmt
|
||||||
selectPresenceForUsersStmt *sql.Stmt
|
selectPresenceForUsersStmt *sql.Stmt
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ const selectPresenceForUserSQL = "" +
|
||||||
" WHERE user_id = $1 LIMIT 1"
|
" WHERE user_id = $1 LIMIT 1"
|
||||||
|
|
||||||
type presenceStatements struct {
|
type presenceStatements struct {
|
||||||
db *sql.DB
|
|
||||||
upsertPresenceStmt *sql.Stmt
|
upsertPresenceStmt *sql.Stmt
|
||||||
selectPresenceForUsersStmt *sql.Stmt
|
selectPresenceForUsersStmt *sql.Stmt
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,11 @@ func MustMakeInternalAPI(t *testing.T) (api.UserInternalAPI, accounts.Database)
|
||||||
MaxOpenConnections: 1,
|
MaxOpenConnections: 1,
|
||||||
MaxIdleConnections: 1,
|
MaxIdleConnections: 1,
|
||||||
},
|
},
|
||||||
|
PresenceDatabase: config.DatabaseOptions{
|
||||||
|
ConnectionString: "file::memory:",
|
||||||
|
MaxOpenConnections: 1,
|
||||||
|
MaxIdleConnections: 1,
|
||||||
|
},
|
||||||
Matrix: &config.Global{
|
Matrix: &config.Global{
|
||||||
ServerName: serverName,
|
ServerName: serverName,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue