summaryrefslogtreecommitdiff
path: root/xmpp.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp.go')
-rw-r--r--xmpp.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/xmpp.go b/xmpp.go
index ae38682..c432a62 100644
--- a/xmpp.go
+++ b/xmpp.go
@@ -16,8 +16,6 @@ const (
)
func xmpp(rxChan chan GuiEvent, txChan chan any, jid string, pwd string) {
- defer func() { txChan <- XmppDisconnect }()
-
conn, err := setupConn(jid)
if err != nil {
log.Print(err)
@@ -39,6 +37,7 @@ func xmpp(rxChan chan GuiEvent, txChan chan any, jid string, pwd string) {
defer sendStreamEnd(enc, dbg, end)
txChan <- XmppConnect
+ defer func() { txChan <- XmppDisconnect }()
for {
select {