From ae8d61bee60a29e2bbfc9cfbb400d8451d00de11 Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 16 Jun 2023 17:06:20 +0200 Subject: Add chan xml.Token xmpp.session.rx This allows the goroutine which fetches all tokens from the server to forward them to the main goroutine of the session. --- xmpp/encoder_decoder.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xmpp/encoder_decoder.go') diff --git a/xmpp/encoder_decoder.go b/xmpp/encoder_decoder.go index c8ccd89..7a917da 100644 --- a/xmpp/encoder_decoder.go +++ b/xmpp/encoder_decoder.go @@ -65,7 +65,8 @@ func (ed *encoderDecoder) run() { if err != nil { log.Println("Could not encode to server stream log") } err = ed.sl.Flush() if err != nil { log.Println("Could not flush server stream log") } - _ = xml.CopyToken(t) // TODO do something meaningful here + c := xml.CopyToken(t) + ed.session.rx <- c } if err != nil { if errors.Is(err, io.EOF) { return } -- cgit v1.2.3-70-g09d2