diff options
author | xengineering <me@xengineering.eu> | 2023-09-04 22:47:31 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-09-04 22:47:31 +0200 |
commit | dc8ff3e7d214c6a390f2aa5c794891b17c418640 (patch) | |
tree | a364e58464c4a2a4e829e7f087da52b9170f8bbe /limox.go | |
parent | 93668403433cbfc22fe9c38ebbd6ef67af625ad2 (diff) | |
download | limox-dc8ff3e7d214c6a390f2aa5c794891b17c418640.tar limox-dc8ff3e7d214c6a390f2aa5c794891b17c418640.tar.zst limox-dc8ff3e7d214c6a390f2aa5c794891b17c418640.zip |
Add xmpp.SessionFrontend.Disconnect()session-struct
This is the first convenience function implemented inside the xmpp
module but for the goroutine of the using application.
Diffstat (limited to 'limox.go')
-rw-r--r-- | limox.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -25,7 +25,7 @@ type Limox struct { JidEditor widget.Editor PwdEditor widget.Editor MainButton widget.Clickable - frontend xmpp.SessionFrontend + sf xmpp.SessionFrontend State LimoxState Window *app.Window Operations op.Ops @@ -62,7 +62,7 @@ func (l *Limox) run() error { } l.draw(e) } - case data := <-l.frontend.In: + case data := <-l.sf.In: switch data.(type) { case xmpp.SessionDisconnect: l.State = Disconnected @@ -83,13 +83,13 @@ func (l *Limox) buttonCallback() { pwd := l.PwdEditor.Text() setLastJid(jid) setLastPwd(pwd) - l.frontend = xmpp.StartSession(jid, pwd) + l.sf = xmpp.StartSession(jid, pwd) l.State = Connecting case Connecting: - go func() { l.frontend.Out <- xmpp.SessionShouldDisconnect{} }() + l.sf.Disconnect() l.State = Disconnected case Connected: - go func() { l.frontend.Out <- xmpp.SessionShouldDisconnect{} }() + l.sf.Disconnect() l.State = Disconnected } } |