From dc8ff3e7d214c6a390f2aa5c794891b17c418640 Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 4 Sep 2023 22:47:31 +0200 Subject: Add xmpp.SessionFrontend.Disconnect() This is the first convenience function implemented inside the xmpp module but for the goroutine of the using application. --- xmpp/session.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmpp') diff --git a/xmpp/session.go b/xmpp/session.go index ad90c5e..2c9fbb3 100644 --- a/xmpp/session.go +++ b/xmpp/session.go @@ -18,6 +18,10 @@ type SessionFrontend struct { Out chan any } +func (sf *SessionFrontend) Disconnect() { + go func() { sf.Out <- SessionShouldDisconnect{} }() +} + type session struct { jid string pwd string -- cgit v1.2.3-70-g09d2