1
0
Fork 0
forked from External/ergo

allow overriding services hostname

Fixes #1407
This commit is contained in:
Shivaram Lingamneni 2020-11-28 23:40:21 -05:00
parent 9214d978d0
commit 3ee6fd1f6c
5 changed files with 41 additions and 13 deletions

View file

@ -316,6 +316,19 @@ func makeServiceHelpTextGenerator(cmd string, banner string) func(*Client) strin
}
}
func overrideServicePrefixes(hostname string) error {
if hostname == "" {
return nil
}
if !utils.IsHostname(hostname) {
return fmt.Errorf("`%s` is an invalid services hostname", hostname)
}
for _, serv := range OragonoServices {
serv.prefix = fmt.Sprintf("%s!%s@%s", serv.Name, serv.Name, hostname)
}
return nil
}
func initializeServices() {
// this modifies the global Commands map,
// so it must be called from irc/commands.go's init()