server: send contented_server option down websocket to client

This commit is contained in:
mappu 2017-10-15 20:56:38 +13:00
parent b8791f6aa2
commit 37014f7f52
2 changed files with 6 additions and 1 deletions

View File

@ -2,7 +2,8 @@ package main
type Config struct {
App struct {
MotdHTML string `json:"motd"`
MotdHTML string `json:"motd"`
ContentedServer string `json:"contented_server"`
}
Web struct {

View File

@ -170,6 +170,10 @@ func (this *App) SocketIOServer(so socketio.Socket) {
so.Emit("raw", this.cfg.App.MotdHTML+"<br>")
so.Emit("sys", "Enter a name to connect as (or name:pass for a registered nick)")
if len(this.cfg.App.ContentedServer) > 0 {
so.Emit("contented", this.cfg.App.ContentedServer)
}
doneChan := make(chan struct{}, 0)
so.On("hello", func(data map[string]string) {