From 37014f7f522f9556f49462b5e59a3b3ba7a3b461 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 15 Oct 2017 20:56:38 +1300 Subject: [PATCH] server: send contented_server option down websocket to client --- Config.go | 3 ++- main.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Config.go b/Config.go index 48be46c..86d1ee0 100644 --- a/Config.go +++ b/Config.go @@ -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 { diff --git a/main.go b/main.go index 6ae8d2b..0e96daf 100644 --- a/main.go +++ b/main.go @@ -170,6 +170,10 @@ func (this *App) SocketIOServer(so socketio.Socket) { so.Emit("raw", this.cfg.App.MotdHTML+"
") 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) {