diff options
author | xengineering <me@xengineering.eu> | 2023-06-03 20:20:30 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-03 20:21:11 +0200 |
commit | 30d99c706e3a75948c49289fc6b0317258957819 (patch) | |
tree | 76d63751700e6946655e08cb71553b2f4a19c816 /limox.go | |
parent | f1633a2ab8cb10cb49642c16700379270fb9dc99 (diff) | |
download | limox-30d99c706e3a75948c49289fc6b0317258957819.tar limox-30d99c706e3a75948c49289fc6b0317258957819.tar.zst limox-30d99c706e3a75948c49289fc6b0317258957819.zip |
Implement dummy session
Minimal step towards session-based XMPP architecture.
Diffstat (limited to 'limox.go')
-rw-r--r-- | limox.go | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -26,6 +26,7 @@ type Limox struct { JidEditor widget.Editor PwdEditor widget.Editor MainButton widget.Clickable + session *xmpp.Session XmppConn chan xmpp.Event State LimoxState Window *app.Window @@ -85,13 +86,15 @@ func (l *Limox) buttonCallback() { pwd := l.PwdEditor.Text() setLastJid(jid) setLastPwd(pwd) - c := xmpp.NewConn(l.XmppConn, jid, pwd) - go c.Run() + l.session = xmpp.NewSession(jid, pwd) + l.XmppConn = l.session.Out + go l.session.Run() l.State = Connecting case Connecting: + l.session.Close() l.State = Disconnected case Connected: - l.XmppConn <- xmpp.ShouldDisconnectEvent + l.session.Close() l.State = Disconnected } } |