nicer state change display
This commit is contained in:
parent
f23aee143a
commit
44e7c0fbcf
5
main.go
5
main.go
@ -107,11 +107,12 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
|
|||||||
so.Emit("part", UserMessageStruct{User: hev.Nick})
|
so.Emit("part", UserMessageStruct{User: hev.Nick})
|
||||||
|
|
||||||
case libnmdc.EVENT_CONNECTION_STATE_CHANGED:
|
case libnmdc.EVENT_CONNECTION_STATE_CHANGED:
|
||||||
so.Emit("sys", fmt.Sprintf("Connection: %s", hev.StateChange.Format()))
|
|
||||||
if hev.StateChange == libnmdc.CONNECTIONSTATE_CONNECTED {
|
if hev.StateChange == libnmdc.CONNECTIONSTATE_CONNECTED {
|
||||||
so.Emit("hello")
|
so.Emit("hello")
|
||||||
} else {
|
} else if hev.StateChange == libnmdc.CONNECTIONSTATE_DISCONNECTED {
|
||||||
so.Emit("close")
|
so.Emit("close")
|
||||||
|
} else {
|
||||||
|
so.Emit("sys", hev.StateChange.Format())
|
||||||
}
|
}
|
||||||
|
|
||||||
case libnmdc.EVENT_HUBNAME_CHANGED:
|
case libnmdc.EVENT_HUBNAME_CHANGED:
|
||||||
|
Loading…
Reference in New Issue
Block a user