compatibility updates for libnmdc

This commit is contained in:
mappu 2017-11-26 19:51:10 +13:00
parent 80d230be98
commit aacebe5c5f
1 changed files with 6 additions and 6 deletions

12
main.go
View File

@ -49,13 +49,13 @@ func (this *App) HubWorker(Nick, Pass string, so socketio.Socket, done chan stru
selfUser.ClientVersion = libnmdc.DEFAULT_CLIENT_VERSION
hco := libnmdc.HubConnectionOptions{
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
Self: *selfUser,
NickPassword: Pass,
NumEventsToBuffer: 0,
Address: libnmdc.HubAddress(fmt.Sprintf("%s:%d", this.cfg.Hub.Address, this.cfg.Hub.Port)),
Self: selfUser,
NickPassword: Pass,
}
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