From 5d62378683a516f9e12b0190b46dae475b83e0f5 Mon Sep 17 00:00:00 2001 From: xengineering Date: Thu, 11 May 2023 21:04:04 +0200 Subject: Do not share memory between limox and xmpp --- xmpp.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xmpp.go') diff --git a/xmpp.go b/xmpp.go index 5f1d1f9..81de122 100644 --- a/xmpp.go +++ b/xmpp.go @@ -15,12 +15,12 @@ const ( XmppConnect ) -func (l *Limox) xmpp(jid string, pwd string) { - defer func() { l.XmppEvents <- XmppDisconnect }() +func xmpp(rxChan chan GuiEvent, txChan chan any, jid string, pwd string) { + defer func() { txChan <- XmppDisconnect }() conn, err := setupConn(jid) if err != nil { - l.XmppEvents <- err + txChan <- err return } defer conn.Close() @@ -36,11 +36,11 @@ func (l *Limox) xmpp(jid string, pwd string) { end := sendStreamStart(enc, jid) defer sendStreamEnd(enc, end) - l.XmppEvents <- XmppConnect + txChan <- XmppConnect for { select { - case ev := <-l.GuiEvents: + case ev := <-rxChan: switch ev { case Disconnect: return -- cgit v1.2.3-70-g09d2