aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage/storage.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-03-28 16:25:26 +0100
committerGitHub <noreply@github.com>2022-03-28 16:25:26 +0100
commit7972915806348847ecd9a9b8a1b1ff0609cb883c (patch)
treedfbf719e8229dc4faeef133b150b2d7a6dc7eac8 /userapi/storage/storage.go
parent0692be44d91a42945dde0eab3e2f7481cc2e0896 (diff)
User directory for nearby Pinecone peers (P2P demo) (#2311)
* User directory for nearby Pinecone peers * Fix mux routing * Use config to determine which server notices user to exclude
Diffstat (limited to 'userapi/storage/storage.go')
-rw-r--r--userapi/storage/storage.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/userapi/storage/storage.go b/userapi/storage/storage.go
index 4711439a..f372fe7d 100644
--- a/userapi/storage/storage.go
+++ b/userapi/storage/storage.go
@@ -30,12 +30,12 @@ import (
// NewDatabase opens a new Postgres or Sqlite database (based on dataSourceName scheme)
// and sets postgres connection parameters
-func NewDatabase(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName, bcryptCost int, openIDTokenLifetimeMS int64, loginTokenLifetime time.Duration) (Database, error) {
+func NewDatabase(dbProperties *config.DatabaseOptions, serverName gomatrixserverlib.ServerName, bcryptCost int, openIDTokenLifetimeMS int64, loginTokenLifetime time.Duration, serverNoticesLocalpart string) (Database, error) {
switch {
case dbProperties.ConnectionString.IsSQLite():
- return sqlite3.NewDatabase(dbProperties, serverName, bcryptCost, openIDTokenLifetimeMS, loginTokenLifetime)
+ return sqlite3.NewDatabase(dbProperties, serverName, bcryptCost, openIDTokenLifetimeMS, loginTokenLifetime, serverNoticesLocalpart)
case dbProperties.ConnectionString.IsPostgres():
- return postgres.NewDatabase(dbProperties, serverName, bcryptCost, openIDTokenLifetimeMS, loginTokenLifetime)
+ return postgres.NewDatabase(dbProperties, serverName, bcryptCost, openIDTokenLifetimeMS, loginTokenLifetime, serverNoticesLocalpart)
default:
return nil, fmt.Errorf("unexpected database type")
}