Browse Source

handle code attribute in stanza errors

rfc 3920 allowed a "code" attribute in stanza errors. For compatibility,
we allow for (but ignore) it.
master
Philipp Balzarek 12 years ago
parent
commit
08a0300071
  1. 8
      source/Network/Xmpp/Marshal.hs

8
source/Network/Xmpp/Marshal.hs

@ -188,10 +188,12 @@ xpStanzaErrorCondition = ("xpErrorCondition" , "") <?+> xpWrapEither @@ -188,10 +188,12 @@ xpStanzaErrorCondition = ("xpErrorCondition" , "") <?+> xpWrapEither
xpStanzaError :: PU [Node] StanzaError
xpStanzaError = ("xpStanzaError" , "") <?+> xpWrap
(\(tp, (cond, txt, ext)) -> StanzaError tp cond txt ext)
(\(StanzaError tp cond txt ext) -> (tp, (cond, txt, ext)))
(\((tp, _code), (cond, txt, ext)) -> StanzaError tp cond txt ext)
(\(StanzaError tp cond txt ext) -> ((tp, Nothing), (cond, txt, ext)))
(xpElem "{jabber:client}error"
(xpAttr "type" xpStanzaErrorType)
(xp2Tuple
(xpAttr "type" xpStanzaErrorType)
(xpAttribute' "code" xpId))
(xp3Tuple
xpStanzaErrorCondition
(xpOption $ xpElem "{jabber:client}text"

Loading…
Cancel
Save