From 6fd36e07a5d645295f34fcbab36cce5e08a9d84c Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 30 Jun 2023 13:28:06 +0200 Subject: Make streamFeaturesHandler() more generic The new structure allows to check for different stream features and act according to them or - if nothing matches - do nothing apart from an error message to the log. --- xmpp/stream_pair.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmpp/stream_pair.go b/xmpp/stream_pair.go index f1de345..693972e 100644 --- a/xmpp/stream_pair.go +++ b/xmpp/stream_pair.go @@ -93,10 +93,10 @@ func closeStream(s *session, end xml.EndElement) { } func streamFeaturesHandler(s *session, e []xml.Token) { - sasl := hasSaslPlain(e) - if sasl { + if hasSaslPlain(e) { s.sasl() - } else { - log.Println("Stream is not compatible with SASL PLAIN mechanism!") + return } + + log.Println("Stream has no implemented features!") } -- cgit v1.2.3-70-g09d2