Rename Config.Log{Driver,Path} to MsgStore

This commit is contained in:
Simon Ser 2023-05-23 11:23:38 +02:00
parent cbdaf46592
commit 9b9fc60f62
4 changed files with 7 additions and 7 deletions

View File

@ -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,

View File

@ -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"] = ""

View File

@ -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

View File

@ -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":