Add per-chat nick setting, update README.md

This commit is contained in:
eleksir
2023-11-05 16:33:17 +03:00
parent d88f08479d
commit 31490b0922
7 changed files with 47 additions and 20 deletions

View File

@@ -187,11 +187,15 @@ func readConfig() error { //nolint:gocognit,gocyclo
return errors.New("no jabber channels/rooms defined in config, quitting") //nolint:goerr113
}
for _, channel := range sampleConfig.Jabber.Channels {
for n, channel := range sampleConfig.Jabber.Channels {
if channel.Name == "" {
return errors.New("no \"name\" entry in jabber channel config")
}
if channel.Nick == "" {
sampleConfig.Jabber.Channels[n].Nick = sampleConfig.Jabber.Nick
}
// channel.Password может быть пустым, тогда пароля нет
// channel.Bayes.Enabled будет false, если не проставлен
@@ -260,6 +264,7 @@ func readConfig() error { //nolint:gocognit,gocyclo
config = sampleConfig
configLoaded = true
log.Infof("Using %s as config file", location) //nolint:wsl
break