|
|
|
@ -42,11 +42,15 @@ module Network.XMPP |
|
|
|
, module Network.XMPP.Message |
|
|
|
, module Network.XMPP.Message |
|
|
|
, xmppConnect |
|
|
|
, xmppConnect |
|
|
|
, xmppNewSession |
|
|
|
, xmppNewSession |
|
|
|
|
|
|
|
, connect |
|
|
|
|
|
|
|
, startTLS |
|
|
|
|
|
|
|
, auth |
|
|
|
) where |
|
|
|
) where |
|
|
|
|
|
|
|
|
|
|
|
import Data.Text as Text |
|
|
|
import Data.Text as Text |
|
|
|
|
|
|
|
|
|
|
|
import Network |
|
|
|
import Network |
|
|
|
|
|
|
|
import qualified Network.TLS as TLS |
|
|
|
import Network.XMPP.Bind |
|
|
|
import Network.XMPP.Bind |
|
|
|
import Network.XMPP.Concurrent |
|
|
|
import Network.XMPP.Concurrent |
|
|
|
import Network.XMPP.Message |
|
|
|
import Network.XMPP.Message |
|
|
|
@ -62,4 +66,14 @@ xmppConnect :: HostName -> Text -> XMPPConMonad (Either StreamError ()) |
|
|
|
xmppConnect address hostname = xmppRawConnect address hostname >> xmppStartStream |
|
|
|
xmppConnect address hostname = xmppRawConnect address hostname >> xmppStartStream |
|
|
|
|
|
|
|
|
|
|
|
xmppNewSession :: XMPPThread a -> IO (a, XMPPConState) |
|
|
|
xmppNewSession :: XMPPThread a -> IO (a, XMPPConState) |
|
|
|
xmppNewSession = withNewSession . runThreaded |
|
|
|
xmppNewSession = withNewSession . runThreaded |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
startTLS :: TLS.TLSParams -> XMPPThread (Either XMPPTLSError ()) |
|
|
|
|
|
|
|
startTLS = withConnection . xmppStartTLS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auth :: Text.Text -> Text.Text -> XMPPThread (Either String Text.Text) |
|
|
|
|
|
|
|
auth username passwd = withConnection $ xmppSASL username passwd |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect :: HostName -> Text -> XMPPThread (Either StreamError ()) |
|
|
|
|
|
|
|
connect address hostname = withConnection $ xmppConnect address hostname |
|
|
|
|