You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
{-# OPTIONS_HADDOCK hide #-}
|
|
|
|
|
module Network.Xmpp.Concurrent.Channels.Basic where
|
|
|
|
|
|
|
|
|
|
import Control.Concurrent.STM
|
|
|
|
|
import Network.Xmpp.Concurrent.Channels.Types
|
|
|
|
|
import Network.Xmpp.Types
|
|
|
|
|
|
|
|
|
|
-- | Send a stanza to the server.
|
|
|
|
|
sendStanza :: Stanza -> Session -> IO ()
|
|
|
|
|
sendStanza a session = atomically $ writeTChan (outCh session) a
|
|
|
|
|
|
|
|
|
|
-- | Create a new session object with the inbound channel duplicated
|
|
|
|
|
dupSession :: Session -> IO Session
|
|
|
|
|
dupSession session = do
|
|
|
|
|
stanzaCh' <- atomically $ dupTChan (stanzaCh session)
|
|
|
|
|
return $ session {stanzaCh = stanzaCh'}
|