summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--limox.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/limox.go b/limox.go
index 87e20de..5bb2d57 100644
--- a/limox.go
+++ b/limox.go
@@ -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
}
}