summaryrefslogtreecommitdiff
path: root/Presence/XMPP.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Presence/XMPP.hs')
-rw-r--r--Presence/XMPP.hs19
1 files changed, 3 insertions, 16 deletions
diff --git a/Presence/XMPP.hs b/Presence/XMPP.hs
index 5c5cbaef..e15b10cc 100644
--- a/Presence/XMPP.hs
+++ b/Presence/XMPP.hs
@@ -321,35 +321,22 @@ fromClient session cmdChan = doNestingXML $ do
321 log "begin-doc" 321 log "begin-doc"
322 withXML $ \xml -> do 322 withXML $ \xml -> do
323 withJust (elementAttrs "stream" xml) $ \stream_attrs -> do 323 withJust (elementAttrs "stream" xml) $ \stream_attrs -> do
324 log $ "stream " <++> bshow stream_attrs 324 log $ "stream atributes: " <++> bshow stream_attrs
325 host <- liftIO $ do 325 host <- liftIO $ do
326 jid <- getJID session 326 jid <- getJID session
327 names <- getNamesForPeer (peer jid) 327 names <- getNamesForPeer (peer jid)
328 return (S.decodeUtf8 . head $ names) 328 return (S.decodeUtf8 . head $ names)
329 send $ greet host 329 send $ greet host
330 330
331{-
332 fix $ \loop -> do
333 xml <- mawait
334 log $ bshow xml
335 let isIQ n = n=="{jabber:client}iq"
336 case xml of
337 _ | eventIsEndElement xml -> return ()
338 tag@(EventBeginElement name attrs) | isIQ name -> doIQ session cmdChan tag >> loop
339
340 tag@(EventBeginElement _ _) -> do
341 xs <- gatherElement tag Seq.empty
342 prettyPrint "client-in: ignoring..." (toList xs)
343 loop
344 _ -> loop
345-}
346 fix $ \loop -> do 331 fix $ \loop -> do
347 whenJust nextElement $ \stanza -> do 332 whenJust nextElement $ \stanza -> do
348 stanza_lvl <- nesting 333 stanza_lvl <- nesting
334
349 let unhandledStanza = liftIO $ putStrLn ("ignoring stanza: "++show stanza) 335 let unhandledStanza = liftIO $ putStrLn ("ignoring stanza: "++show stanza)
350 case () of 336 case () of
351 _ | stanza `isIQOf` iqTypeSet -> handleIQSet session cmdChan stanza 337 _ | stanza `isIQOf` iqTypeSet -> handleIQSet session cmdChan stanza
352 _ | otherwise -> unhandledStanza 338 _ | otherwise -> unhandledStanza
339
353 awaitCloser stanza_lvl 340 awaitCloser stanza_lvl
354 loop 341 loop
355 342