mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-11 02:48:11 -07:00
fix #1167
This commit is contained in:
+1
-30
@@ -6,7 +6,6 @@
|
||||
package irc
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
@@ -21,6 +20,7 @@ import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/goshuirc/irc-go/ircfmt"
|
||||
|
||||
"github.com/oragono/oragono/irc/caps"
|
||||
"github.com/oragono/oragono/irc/connection_limits"
|
||||
"github.com/oragono/oragono/irc/history"
|
||||
@@ -667,35 +667,6 @@ func (server *Server) setupPprofListener(config *Config) {
|
||||
}
|
||||
}
|
||||
|
||||
func (config *Config) loadMOTD() (err error) {
|
||||
if config.Server.MOTD != "" {
|
||||
file, err := os.Open(config.Server.MOTD)
|
||||
if err == nil {
|
||||
defer file.Close()
|
||||
|
||||
reader := bufio.NewReader(file)
|
||||
for {
|
||||
line, err := reader.ReadString('\n')
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
line = strings.TrimRight(line, "\r\n")
|
||||
|
||||
if config.Server.MOTDFormatting {
|
||||
line = ircfmt.Unescape(line)
|
||||
}
|
||||
|
||||
// "- " is the required prefix for MOTD, we just add it here to make
|
||||
// bursting it out to clients easier
|
||||
line = fmt.Sprintf("- %s", line)
|
||||
|
||||
config.Server.motdLines = append(config.Server.motdLines, line)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (server *Server) loadDatastore(config *Config) error {
|
||||
// open the datastore and load server state for which it (rather than config)
|
||||
// is the source of truth
|
||||
|
||||
Reference in New Issue
Block a user