From 8d555b6790ccbf246ffa87d875d5d468b57d46de Mon Sep 17 00:00:00 2001 From: Philipp Balzarek Date: Fri, 23 Aug 2013 15:33:03 +0200 Subject: [PATCH] make disco code compile again --- source/Network/Xmpp/Xep/ServiceDiscovery.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/Network/Xmpp/Xep/ServiceDiscovery.hs b/source/Network/Xmpp/Xep/ServiceDiscovery.hs index 6767fd7..766ab1e 100644 --- a/source/Network/Xmpp/Xep/ServiceDiscovery.hs +++ b/source/Network/Xmpp/Xep/ServiceDiscovery.hs @@ -16,7 +16,6 @@ module Network.Xmpp.Xep.ServiceDiscovery ) where -import Control.Applicative((<$>)) import Control.Monad.IO.Class import Control.Monad.Error @@ -53,7 +52,7 @@ discoInfoNS :: Text.Text discoInfoNS = "http://jabber.org/protocol/disco#info" infoN :: Text.Text -> Name -infoN name = (Name name (Just discoInfoNS) Nothing) +infoN name = Name name (Just discoInfoNS) Nothing xpIdentities = xpWrap (map $(\(cat, n, tp, lang) -> Ident cat n tp lang) . fst) (map $ \(Ident cat n tp lang) -> ((cat, n, tp, lang),())) $ @@ -89,9 +88,10 @@ queryInfo :: Jid -- ^ Entity to query queryInfo to node context = do res <- sendIQ' (Just to) Get Nothing queryBody context return $ case res of - IQResponseError e -> Left $ DiscoIQError (Just e) - IQResponseTimeout -> Left $ DiscoTimeout - IQResponseResult r -> case iqResultPayload r of + Nothing -> Left $ DiscoIQError Nothing + Just (IQResponseError e) -> Left $ DiscoIQError (Just e) + Just IQResponseTimeout -> Left $ DiscoTimeout + Just (IQResponseResult r) -> case iqResultPayload r of Nothing -> Left DiscoNoQueryElement Just p -> case unpickleElem xpQueryInfo p of Left e -> Left $ DiscoXmlError p e @@ -155,9 +155,10 @@ queryItems :: Jid -- ^ Entity to query queryItems to node session = do res <- sendIQ' (Just to) Get Nothing queryBody session return $ case res of - IQResponseError e -> Left $ DiscoIQError (Just e) - IQResponseTimeout -> Left $ DiscoTimeout - IQResponseResult r -> case iqResultPayload r of + Nothing -> Left $ DiscoIQError Nothing + Just (IQResponseError e) -> Left $ DiscoIQError (Just e) + Just IQResponseTimeout -> Left $ DiscoTimeout + Just (IQResponseResult r) -> case iqResultPayload r of Nothing -> Left DiscoNoQueryElement Just p -> case unpickleElem xpQueryItems p of Left e -> Left $ DiscoXmlError p e