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. 6
      source/Network/Xmpp/Marshal.hs

6
source/Network/Xmpp/Marshal.hs

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

Loading…
Cancel
Save