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{
|
cfg := &soju.Config{
|
||||||
Hostname: raw.Hostname,
|
Hostname: raw.Hostname,
|
||||||
Title: raw.Title,
|
Title: raw.Title,
|
||||||
LogDriver: raw.MsgStore.Driver,
|
MsgStoreDriver: raw.MsgStore.Driver,
|
||||||
LogPath: raw.MsgStore.Source,
|
MsgStorePath: raw.MsgStore.Source,
|
||||||
HTTPOrigins: raw.HTTPOrigins,
|
HTTPOrigins: raw.HTTPOrigins,
|
||||||
AcceptProxyIPs: raw.AcceptProxyIPs,
|
AcceptProxyIPs: raw.AcceptProxyIPs,
|
||||||
MaxUserNetworks: raw.MaxUserNetworks,
|
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
|
// TODO: this is racy, we should only enable chathistory after
|
||||||
// authentication and then check that user.msgStore implements
|
// authentication and then check that user.msgStore implements
|
||||||
// chatHistoryMessageStore
|
// chatHistoryMessageStore
|
||||||
switch srv.Config().LogDriver {
|
switch srv.Config().MsgStoreDriver {
|
||||||
case "fs", "db":
|
case "fs", "db":
|
||||||
dc.caps.Available["draft/chathistory"] = ""
|
dc.caps.Available["draft/chathistory"] = ""
|
||||||
dc.caps.Available["soju.im/search"] = ""
|
dc.caps.Available["soju.im/search"] = ""
|
||||||
|
@ -138,8 +138,8 @@ func (ln *retryListener) Accept() (net.Conn, error) {
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Hostname string
|
Hostname string
|
||||||
Title string
|
Title string
|
||||||
LogDriver string
|
MsgStoreDriver string
|
||||||
LogPath string
|
MsgStorePath string
|
||||||
HTTPOrigins []string
|
HTTPOrigins []string
|
||||||
AcceptProxyIPs config.IPSet
|
AcceptProxyIPs config.IPSet
|
||||||
MaxUserNetworks int
|
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)}
|
logger := &prefixLogger{srv.Logger, fmt.Sprintf("user %q: ", record.Username)}
|
||||||
|
|
||||||
var msgStore msgstore.Store
|
var msgStore msgstore.Store
|
||||||
switch srv.Config().LogDriver {
|
switch srv.Config().MsgStoreDriver {
|
||||||
case "fs":
|
case "fs":
|
||||||
msgStore = msgstore.NewFSStore(srv.Config().LogPath, record)
|
msgStore = msgstore.NewFSStore(srv.Config().MsgStorePath, record)
|
||||||
case "db":
|
case "db":
|
||||||
msgStore = msgstore.NewDBStore(srv.db)
|
msgStore = msgstore.NewDBStore(srv.db)
|
||||||
case "memory":
|
case "memory":
|
||||||
|
Loading…
Reference in New Issue
Block a user