|
|
|
|
@ -3,7 +3,9 @@ module Network.Xmpp.Concurrent.Basic where
@@ -3,7 +3,9 @@ module Network.Xmpp.Concurrent.Basic where
|
|
|
|
|
|
|
|
|
|
import Control.Concurrent.STM |
|
|
|
|
import Network.Xmpp.Concurrent.Types |
|
|
|
|
import Network.Xmpp.Stream |
|
|
|
|
import Network.Xmpp.Types |
|
|
|
|
import Control.Monad.State.Strict |
|
|
|
|
|
|
|
|
|
-- | Send a stanza to the server. |
|
|
|
|
sendStanza :: Stanza -> Session -> IO () |
|
|
|
|
@ -14,3 +16,9 @@ dupSession :: Session -> IO Session
@@ -14,3 +16,9 @@ dupSession :: Session -> IO Session
|
|
|
|
|
dupSession session = do |
|
|
|
|
stanzaCh' <- atomically $ dupTChan (stanzaCh session) |
|
|
|
|
return $ session {stanzaCh = stanzaCh'} |
|
|
|
|
|
|
|
|
|
-- | Return the JID assigned to us by the server |
|
|
|
|
getJid :: Session -> IO (Maybe Jid) |
|
|
|
|
getJid Session{streamRef = st} = do |
|
|
|
|
s <- atomically $ readTMVar st |
|
|
|
|
withStream' (gets streamJid) s |
|
|
|
|
|