From 00eb50e9876d9afcfdf6bd52ac937ffaedc1f27b Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 16 Feb 2014 02:58:37 -0500 Subject: Use XMPPServerParameters instead of ResourcePolicy. Also: some presence status parsing. --- Presence/Nesting.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Presence/Nesting.hs') diff --git a/Presence/Nesting.hs b/Presence/Nesting.hs index 24f9baad..850cb8c0 100644 --- a/Presence/Nesting.hs +++ b/Presence/Nesting.hs @@ -27,6 +27,12 @@ doNestingXML m = nesting :: Monad m => NestingXML o m Int nesting = lift $ (return . nestingLevel) =<< get +xmlLang :: Monad m => NestingXML o m (Maybe Lang) +xmlLang = fmap (fmap snd . top . langStack) (lift get) + where + top ( a :! as ) = Just a + top _ = Nothing + trackNesting :: Monad m => ConduitM Event Event (StateT XMLState m) () trackNesting = awaitForever doit @@ -77,3 +83,4 @@ nextElement = do if (lvl'>=lvl) then loop else return Nothing + -- cgit v1.2.3