|
|
|
@ -121,7 +121,8 @@ handleIQ iqHands out sta as = do |
|
|
|
handleIQResponse :: TVar IQHandlers -> Either IQError IQResult -> IO () |
|
|
|
handleIQResponse :: TVar IQHandlers -> Either IQError IQResult -> IO () |
|
|
|
handleIQResponse handlers iq = atomically $ do |
|
|
|
handleIQResponse handlers iq = atomically $ do |
|
|
|
(byNS, byID) <- readTVar handlers |
|
|
|
(byNS, byID) <- readTVar handlers |
|
|
|
case Map.updateLookupWithKey (\_ _ -> Nothing) (iqID iq) byID of |
|
|
|
case Map.updateLookupWithKey (\_ _ -> Nothing) (iqID iq, iqFrom iq) |
|
|
|
|
|
|
|
byID of |
|
|
|
(Nothing, _) -> return () -- We are not supposed to send an error. |
|
|
|
(Nothing, _) -> return () -- We are not supposed to send an error. |
|
|
|
(Just tmvar, byID') -> do |
|
|
|
(Just tmvar, byID') -> do |
|
|
|
let answer = Just (either IQResponseError IQResponseResult iq, as) |
|
|
|
let answer = Just (either IQResponseError IQResponseResult iq, as) |
|
|
|
@ -130,6 +131,8 @@ handleIQ iqHands out sta as = do |
|
|
|
where |
|
|
|
where |
|
|
|
iqID (Left err') = iqErrorID err' |
|
|
|
iqID (Left err') = iqErrorID err' |
|
|
|
iqID (Right iq') = iqResultID iq' |
|
|
|
iqID (Right iq') = iqResultID iq' |
|
|
|
|
|
|
|
iqFrom (Left err') = iqErrorFrom err' |
|
|
|
|
|
|
|
iqFrom (Right iq') = iqResultFrom iq' |
|
|
|
|
|
|
|
|
|
|
|
-- | Creates and initializes a new Xmpp context. |
|
|
|
-- | Creates and initializes a new Xmpp context. |
|
|
|
newSession :: Stream |
|
|
|
newSession :: Stream |
|
|
|
|