Rename Config.Log{Driver,Path} to MsgStore
This commit is contained in:
parent
cbdaf46592
commit
9b9fc60f62
@ -92,8 +92,8 @@ func loadConfig() (*config.Server, *soju.Config, error) {
|
||||
cfg := &soju.Config{
|
||||
Hostname: raw.Hostname,
|
||||
Title: raw.Title,
|
||||
LogDriver: raw.MsgStore.Driver,
|
||||
LogPath: raw.MsgStore.Source,
|
||||
MsgStoreDriver: raw.MsgStore.Driver,
|
||||
MsgStorePath: raw.MsgStore.Source,
|
||||
HTTPOrigins: raw.HTTPOrigins,
|
||||
AcceptProxyIPs: raw.AcceptProxyIPs,
|
||||
MaxUserNetworks: raw.MaxUserNetworks,
|
||||
|
@ -382,7 +382,7 @@ func newDownstreamConn(srv *Server, ic ircConn, id uint64) *downstreamConn {
|
||||
// TODO: this is racy, we should only enable chathistory after
|
||||
// authentication and then check that user.msgStore implements
|
||||
// chatHistoryMessageStore
|
||||
switch srv.Config().LogDriver {
|
||||
switch srv.Config().MsgStoreDriver {
|
||||
case "fs", "db":
|
||||
dc.caps.Available["draft/chathistory"] = ""
|
||||
dc.caps.Available["soju.im/search"] = ""
|
||||
|
@ -138,8 +138,8 @@ func (ln *retryListener) Accept() (net.Conn, error) {
|
||||
type Config struct {
|
||||
Hostname string
|
||||
Title string
|
||||
LogDriver string
|
||||
LogPath string
|
||||
MsgStoreDriver string
|
||||
MsgStorePath string
|
||||
HTTPOrigins []string
|
||||
AcceptProxyIPs config.IPSet
|
||||
MaxUserNetworks int
|
||||
|
4
user.go
4
user.go
@ -537,9 +537,9 @@ func newUser(srv *Server, record *database.User) *user {
|
||||
logger := &prefixLogger{srv.Logger, fmt.Sprintf("user %q: ", record.Username)}
|
||||
|
||||
var msgStore msgstore.Store
|
||||
switch srv.Config().LogDriver {
|
||||
switch srv.Config().MsgStoreDriver {
|
||||
case "fs":
|
||||
msgStore = msgstore.NewFSStore(srv.Config().LogPath, record)
|
||||
msgStore = msgstore.NewFSStore(srv.Config().MsgStorePath, record)
|
||||
case "db":
|
||||
msgStore = msgstore.NewDBStore(srv.db)
|
||||
case "memory":
|
||||
|
Loading…
Reference in New Issue
Block a user