]> git.0d.be Git - barnard.git/blobdiff - main.go
remove UI stuff, turn into CLI
[barnard.git] / main.go
diff --git a/main.go b/main.go
index bbe84fa14815b4d43e54a25070547b41d96ce8dd..dbdc2090b5f59b73cc913fe9224b8b00602346fa 100644 (file)
--- a/main.go
+++ b/main.go
@@ -6,8 +6,8 @@ import (
        "fmt"
        "os"
 
-       "layeh.com/barnard/uiterm"
        "layeh.com/gumble/gumble"
+       "layeh.com/gumble/gumbleutil"
        _ "layeh.com/gumble/opus"
 )
 
@@ -44,6 +44,14 @@ func main() {
                b.TLSConfig.Certificates = append(b.TLSConfig.Certificates, cert)
        }
 
-       b.Ui = uiterm.New(&b)
-       b.Ui.Run()
+       keepAlive := make(chan bool)
+
+       b.Config.Attach(gumbleutil.Listener{
+               Disconnect: func(e *gumble.DisconnectEvent) {
+                       keepAlive <- true
+               },
+       })
+
+       b.start()
+       <-keepAlive
 }