mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #1167
This commit is contained in:
parent
79764cd549
commit
0b0b1499b0
2 changed files with 36 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue