Browse Source

export nsHack from Network.Xmpp.Stream

master
Philipp Balzarek 13 years ago
parent
commit
008398e75f
  1. 20
      source/Network/Xmpp/Stream.hs

20
source/Network/Xmpp/Stream.hs

@ -353,14 +353,18 @@ pushElement x = do
-- HACK: We remove the "jabber:client" namespace because it is set as -- HACK: We remove the "jabber:client" namespace because it is set as
-- default in the stream. This is to make isode's M-LINK server happy and -- default in the stream. This is to make isode's M-LINK server happy and
-- should be removed once jabber.org accepts prefix-free canonicalization -- should be removed once jabber.org accepts prefix-free canonicalization
nsHack e@(Element{elementName = n})
| nameNamespace n == Just "jabber:client" = nsHack :: Element -> Element
e{ elementName = Name (nameLocalName n) Nothing Nothing nsHack e@(Element{elementName = n})
, elementNodes = map mapNSHack $ elementNodes e | nameNamespace n == Just "jabber:client" =
} e{ elementName = Name (nameLocalName n) Nothing Nothing
| otherwise = e , elementNodes = map mapNSHack $ elementNodes e
mapNSHack (NodeElement e) = NodeElement $ nsHack e }
mapNSHack n = n | otherwise = e
where
mapNSHack :: Node -> Node
mapNSHack (NodeElement el) = NodeElement $ nsHack el
mapNSHack nd = nd
-- | Encode and send stanza -- | Encode and send stanza
pushStanza :: Stanza -> Stream -> IO (Either XmppFailure Bool) pushStanza :: Stanza -> Stream -> IO (Either XmppFailure Bool)

Loading…
Cancel
Save