network-protocol-xmpp 0.3.2 → 0.3.2.1
raw patch · 5 files changed
+15/−15 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Network/Protocol/XMPP/Component.hs +1/−1
- Network/Protocol/XMPP/Connections.hs +1/−1
- Network/Protocol/XMPP/Monad.hs +1/−1
- Network/Protocol/XMPP/XML.hs +11/−11
- network-protocol-xmpp.cabal +1/−1
Network/Protocol/XMPP/Component.hs view
@@ -58,7 +58,7 @@ Nothing -> throwError M.NoComponentStreamID Just x -> return x -parseStreamID :: X.Event -> Maybe T.Text+parseStreamID :: X.SaxEvent -> Maybe T.Text parseStreamID (X.BeginElement _ attrs) = sid where sid = case idAttrs of (x:_) -> Just . X.attributeText $ x
Network/Protocol/XMPP/Connections.hs view
@@ -48,7 +48,7 @@ , " xmlns:stream=\"http://etherx.jabber.org/streams\">" ] -startOfStream :: Integer -> X.Event -> Bool+startOfStream :: Integer -> X.SaxEvent -> Bool startOfStream depth event = case (depth, event) of (1, (X.BeginElement elemName _)) -> qnameStream == elemName _ -> False
Network/Protocol/XMPP/Monad.hs view
@@ -154,7 +154,7 @@ putStanza :: S.Stanza a => a -> XMPP () putStanza = withLock sessionWriteLock . putElement . S.stanzaToElement -readEvents :: (Integer -> X.Event -> Bool) -> XMPP [X.Event]+readEvents :: (Integer -> X.SaxEvent -> Bool) -> XMPP [X.SaxEvent] readEvents done = xmpp where xmpp = do Session h _ p _ _ <- getSession
Network/Protocol/XMPP/XML.hs view
@@ -33,7 +33,7 @@ -- * libxml-sax-0.4 API imitation , Parser- , Event (..)+ , SaxEvent (..) , newParser , parse , eventsToElement@@ -111,7 +111,7 @@ -- quick-and-dirty imitation of libxml-sax-0.4 API; later, this should -- probably be rewritten to use ST and discard the list parsing-data Parser = Parser (SAX.Parser IO) (IORef (Either T.Text [Event]))+data Parser = Parser (SAX.Parser IO) (IORef (Either T.Text [SaxEvent])) newParser :: IO Parser newParser = do@@ -135,7 +135,7 @@ return $ Parser p ref -parse :: Parser -> B.ByteString -> Bool -> IO (Either T.Text [Event])+parse :: Parser -> B.ByteString -> Bool -> IO (Either T.Text [SaxEvent]) parse (Parser p ref) bytes finish = do writeIORef ref (Right []) SAX.parseLazyBytes p bytes@@ -145,7 +145,7 @@ Left err -> Left err Right events -> Right $ reverse events -data Event+data SaxEvent = BeginElement Name [Attribute] | EndElement Name | Characters T.Text@@ -153,9 +153,9 @@ | ProcessingInstruction Instruction readEvents :: Monad m- => (Integer -> Event -> Bool)- -> m [Event]- -> m [Event]+ => (Integer -> SaxEvent -> Bool)+ -> m [SaxEvent]+ -> m [SaxEvent] readEvents done nextEvents = readEvents' 0 [] where readEvents' depth acc = do events <- nextEvents@@ -177,18 +177,18 @@ -- | Convert a list of events to a single 'X.Element'. If the events do not -- contain at least one valid element, 'Nothing' will be returned instead.-eventsToElement :: [Event] -> Maybe Element+eventsToElement :: [SaxEvent] -> Maybe Element eventsToElement es = case eventsToNodes es >>= isElement of (e:_) -> Just e _ -> Nothing -eventsToNodes :: [Event] -> [Node]+eventsToNodes :: [SaxEvent] -> [Node] eventsToNodes = concatMap blockToNodes . splitBlocks -- Split event list into a sequence of "blocks", which are the events including -- and between a pair of tags. <start><start2/></start> and <start/> are both -- single blocks.-splitBlocks :: [Event] -> [[Event]]+splitBlocks :: [SaxEvent] -> [[SaxEvent]] splitBlocks es = ret where (_, _, ret) = foldl splitBlocks' (0, [], []) es @@ -203,7 +203,7 @@ (EndElement _) -> (- 1) _ -> 0 -blockToNodes :: [Event] -> [Node]+blockToNodes :: [SaxEvent] -> [Node] blockToNodes [] = [] blockToNodes (begin:rest) = nodes where end = last rest
network-protocol-xmpp.cabal view
@@ -1,5 +1,5 @@ name: network-protocol-xmpp-version: 0.3.2+version: 0.3.2.1 synopsis: Client <-> Server communication over XMPP license: GPL-3 license-file: License.txt