nicer state change display

This commit is contained in:
mappu 2016-10-08 15:19:47 +13:00
parent f23aee143a
commit 44e7c0fbcf
1 changed files with 3 additions and 2 deletions

View File

@ -107,11 +107,12 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
so.Emit("part", UserMessageStruct{User: hev.Nick})
case libnmdc.EVENT_CONNECTION_STATE_CHANGED:
so.Emit("sys", fmt.Sprintf("Connection: %s", hev.StateChange.Format()))
if hev.StateChange == libnmdc.CONNECTIONSTATE_CONNECTED {
so.Emit("hello")
} else {
} else if hev.StateChange == libnmdc.CONNECTIONSTATE_DISCONNECTED {
so.Emit("close")
} else {
so.Emit("sys", hev.StateChange.Format())
}
case libnmdc.EVENT_HUBNAME_CHANGED: