diff options
-rw-r--r-- | limox.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -80,6 +80,7 @@ func (l *Limox) run() error { } func (l *Limox) buttonCallback() { + c := l.sessionIn switch l.State { case Disconnected: jid := l.JidEditor.Text() @@ -89,10 +90,10 @@ func (l *Limox) buttonCallback() { l.sessionIn = xmpp.StartSession(l.sessionOut, jid, pwd) l.State = Connecting case Connecting: - go func() { l.sessionIn <- xmpp.SessionShouldDisconnect{} }() + go func() { c <- xmpp.SessionShouldDisconnect{} }() l.State = Disconnected case Connected: - go func() { l.sessionIn <- xmpp.SessionShouldDisconnect{} }() + go func() { c <- xmpp.SessionShouldDisconnect{} }() l.State = Disconnected } } |