diff options
author | xengineering <me@xengineering.eu> | 2023-06-30 13:28:06 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-30 13:28:06 +0200 |
commit | 6fd36e07a5d645295f34fcbab36cce5e08a9d84c (patch) | |
tree | 90636256a44f535c3f8b7f0fa72ffaf45d7e573b | |
parent | 04f24e0dade8caf029cb78d3281b3587a8362cbe (diff) | |
download | limox-6fd36e07a5d645295f34fcbab36cce5e08a9d84c.tar limox-6fd36e07a5d645295f34fcbab36cce5e08a9d84c.tar.zst limox-6fd36e07a5d645295f34fcbab36cce5e08a9d84c.zip |
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.
-rw-r--r-- | xmpp/stream_pair.go | 8 |
1 files 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!") } |