compatibility updates for libnmdc

This commit is contained in:
mappu 2017-11-26 19:51:10 +13:00
parent 80d230be98
commit aacebe5c5f

View File

@ -50,12 +50,12 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
hco := libnmdc.HubConnectionOptions{
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
Self: *selfUser,
Self: selfUser,
NickPassword: Pass,
NumEventsToBuffer: 0,
}
hub := hco.Connect()
hubEvents := make(chan libnmdc.HubEvent, 10)
hub := libnmdc.ConnectAsync(&hco, hubEvents)
defer func() {
hub.Disconnect()
@ -105,7 +105,7 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
for {
select {
case hev, ok := <-hub.OnEvent:
case hev, ok := <-hubEvents:
if !ok {
log.Printf("[%s] hub chan closed\n", so.Id())
return // abandon