From 35a9c27783524a035ab6545061f5ecd5fdee6ea7 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 27 Jun 2023 16:05:58 +0200 Subject: xmpp: StartSession(): Switch to directed chan This reduces the risk of using those channels wrong. --- xmpp/session.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xmpp/session.go') diff --git a/xmpp/session.go b/xmpp/session.go index 1bd9bd5..88a01ae 100644 --- a/xmpp/session.go +++ b/xmpp/session.go @@ -13,14 +13,15 @@ type SessionShouldDisconnect struct{} type session struct { jid string - in, out chan any + in chan any + out chan<- any transport *tls.Conn ed encoderDecoder rx chan xml.Token streamEnd xml.EndElement } -func StartSession(out chan any, jid string, pwd string) (in chan any) { +func StartSession(out chan<- any, jid string, pwd string) (in chan<- any) { s := session{} s.jid = jid -- cgit v1.2.3-70-g09d2