Browse Source

export streamState

master
Philipp Balzarek 12 years ago
parent
commit
9e776a39a6
  1. 1
      source/Network/Xmpp.hs
  2. 6
      source/Network/Xmpp/Concurrent/Basic.hs

1
source/Network/Xmpp.hs

@ -58,6 +58,7 @@ module Network.Xmpp @@ -58,6 +58,7 @@ module Network.Xmpp
, closeConnection
, endSession
, waitForStream
, streamState
-- ** Authentication handlers
-- | The use of 'scramSha1' is /recommended/, but 'digestMd5' might be
-- useful for interaction with older implementations.

6
source/Network/Xmpp/Concurrent/Basic.hs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
{-# OPTIONS_HADDOCK hide #-}
module Network.Xmpp.Concurrent.Basic where
import Control.Applicative
import Control.Concurrent.STM
import qualified Control.Exception as Ex
import Control.Monad.State.Strict
@ -70,3 +71,8 @@ waitForStream Session{streamRef = sr} = atomically $ do @@ -70,3 +71,8 @@ waitForStream Session{streamRef = sr} = atomically $ do
Plain -> return ()
Secured -> return ()
_ -> retry
streamState :: Session -> STM ConnectionState
streamState Session{streamRef = sr} = do
s <- readTMVar sr
streamConnectionState <$> (readTMVar $ unStream s)

Loading…
Cancel
Save