From d46caa7afabf26258492531049bb0e706ebc4ec1 Mon Sep 17 00:00:00 2001 From: Jon Kristensen Date: Sun, 10 Jun 2012 20:44:07 +0200 Subject: [PATCH] i was wrong about the possibility of encountering an empty stream:features element --- source/Network/Xmpp/Stream.hs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/Network/Xmpp/Stream.hs b/source/Network/Xmpp/Stream.hs index 0880717..2fa3681 100644 --- a/source/Network/Xmpp/Stream.hs +++ b/source/Network/Xmpp/Stream.hs @@ -110,14 +110,16 @@ pickleStreamFeatures :: PU [Node] ServerFeatures pickleStreamFeatures = xpWrap (\(tls, sasl, rest) -> SF tls (mbl sasl) rest) (\(SF tls sasl rest) -> (tls, lmb sasl, rest)) - (xpDefault (Nothing, Nothing, []) -- In case there is no features element. - (xpElemNodes (Name - "features" (Just "http://etherx.jabber.org/streams") (Just "stream")) - (xpTriple - (xpOption pickleTLSFeature) - (xpOption pickleSaslFeature) - (xpAll xpElemVerbatim) - ) + (xpElemNodes + (Name + "features" + (Just "http://etherx.jabber.org/streams") + (Just "stream") + ) + (xpTriple + (xpOption pickleTLSFeature) + (xpOption pickleSaslFeature) + (xpAll xpElemVerbatim) ) ) where