|
|
|
|
-- |
|
|
|
|
|
-- Module: $Header$
|
|
|
|
|
--
|
|
|
|
|
-- Maintainer: info@jonkri.com
|
|
|
|
|
-- Stability: unstable
|
|
|
|
|
-- Portability: portable
|
|
|
|
|
--
|
|
|
|
|
-- This module allows for low-level access to Pontarius XMPP. Generally, the
|
|
|
|
|
-- "Network.Xmpp" module should be used instead.
|
|
|
|
|
--
|
|
|
|
|
-- The 'Stream' object provides the most low-level access to the XMPP
|
|
|
|
|
-- stream: a simple and single-threaded interface which exposes the conduit
|
|
|
|
|
-- 'Event' source, as well as the input and output byte streams. Custom stateful
|
|
|
|
|
-- 'Stream' functions can be executed using 'withStream'.
|
|
|
|
|
--
|
|
|
|
|
-- The TLS, SASL, and 'Session' functionalities of Pontarius XMPP are built on
|
|
|
|
|
-- top of this API.
|
|
|
|
|
|
Change module structure
We can treat all functions related to SASL negotiation as a submodule
to Pontarius XMPP if there are no dependencies from the internal
Network.Xmpp modules to the SASL functionality. Because of this,
`auth' and `authSimple' were moved from Session.hs to Sasl.hs. As the
bind and the `{urn:ietf:params:xml:ns:xmpp-session}session'
functionality are related only to the SASL negotation functionality,
these functions has been moved to the SASL submodule as well.
As these changes only leaves `connect' in the Session module, it seems
fitting to move `connect' to Network.Xmpp.Stream (not
Network.Xmpp.Connection, as `connect' depends on `startStream').
The internal Network.Xmpp modules (Connection.hs) no longer depend on
the Concurrent submodule. This will decrease the coupling between
Network.Xmpp and the concurrent implementation, making it easier for
developers to replace the concurrent implementation if they wanted to.
As Network.Xmpp.Connection is really a module that breaks the
encapsulation that is Network.Xmpp and the concurrent interface, I
have renamed it Network.Xmpp.Internal. As this frees up the
Network.Xmpp.Connection name, Network.Xmpp.Connection_ can reclaim it.
The high-level "utility" functions of Network.Xmpp.Utilities,
Network.Xmpp.Presence, and Network.Xmpp.Message has been moved to
Network.Xmpp.Utilities. This module contains functions that at most
only depend on the internal Network.Xmpp.Types module, and doesn't
belong in any other module.
The functionality of Jid.hs was moved to Types.hs.
Moved some of the functions of Network.Xmpp.Pickle to
Network.Xmpp.Marshal, and removed the Network.Xmpp.Pickle module.
A module imports diagram corresponding to the one of my last patch
shows the new module structure. I also include a diagram showing
the `Sasl' and `Concurrent' module imports.
13 years ago
|
|
|
module Network.Xmpp.Internal
|
|
|
|
|
( -- * Stream
|
|
|
|
|
Stream(..)
|
|
|
|
|
, StreamConfiguration(..)
|
|
|
|
|
, StreamState(..)
|
|
|
|
|
, StreamHandle(..)
|
|
|
|
|
, StreamFeatures(..)
|
|
|
|
|
, openStream
|
|
|
|
|
, withStream
|
|
|
|
|
-- * TLS
|
|
|
|
|
, tls
|
|
|
|
|
, TlsBehaviour(..)
|
|
|
|
|
-- * Auth
|
|
|
|
|
, SaslHandler
|
|
|
|
|
, auth
|
|
|
|
|
-- * Stanzas
|
|
|
|
|
, Stanza(..)
|
|
|
|
|
, pushStanza
|
|
|
|
|
, pullStanza
|
|
|
|
|
, writeStanza
|
|
|
|
|
-- ** IQ
|
|
|
|
|
, pushIQ
|
|
|
|
|
, iqError
|
|
|
|
|
, iqResult
|
|
|
|
|
, associatedErrorType
|
|
|
|
|
-- * Plugins
|
|
|
|
|
, Plugin
|
|
|
|
|
, Plugin'(..)
|
|
|
|
|
, Annotation(..)
|
|
|
|
|
, connectTls
|
|
|
|
|
)
|
|
|
|
|
where
|
|
|
|
|
|
|
|
|
|
import Network.Xmpp.Concurrent.Basic
|
|
|
|
|
import Network.Xmpp.Concurrent.Types
|
Change module structure
We can treat all functions related to SASL negotiation as a submodule
to Pontarius XMPP if there are no dependencies from the internal
Network.Xmpp modules to the SASL functionality. Because of this,
`auth' and `authSimple' were moved from Session.hs to Sasl.hs. As the
bind and the `{urn:ietf:params:xml:ns:xmpp-session}session'
functionality are related only to the SASL negotation functionality,
these functions has been moved to the SASL submodule as well.
As these changes only leaves `connect' in the Session module, it seems
fitting to move `connect' to Network.Xmpp.Stream (not
Network.Xmpp.Connection, as `connect' depends on `startStream').
The internal Network.Xmpp modules (Connection.hs) no longer depend on
the Concurrent submodule. This will decrease the coupling between
Network.Xmpp and the concurrent implementation, making it easier for
developers to replace the concurrent implementation if they wanted to.
As Network.Xmpp.Connection is really a module that breaks the
encapsulation that is Network.Xmpp and the concurrent interface, I
have renamed it Network.Xmpp.Internal. As this frees up the
Network.Xmpp.Connection name, Network.Xmpp.Connection_ can reclaim it.
The high-level "utility" functions of Network.Xmpp.Utilities,
Network.Xmpp.Presence, and Network.Xmpp.Message has been moved to
Network.Xmpp.Utilities. This module contains functions that at most
only depend on the internal Network.Xmpp.Types module, and doesn't
belong in any other module.
The functionality of Jid.hs was moved to Types.hs.
Moved some of the functions of Network.Xmpp.Pickle to
Network.Xmpp.Marshal, and removed the Network.Xmpp.Pickle module.
A module imports diagram corresponding to the one of my last patch
shows the new module structure. I also include a diagram showing
the `Sasl' and `Concurrent' module imports.
13 years ago
|
|
|
import Network.Xmpp.Sasl
|
|
|
|
|
import Network.Xmpp.Sasl.Types
|
|
|
|
|
import Network.Xmpp.Stanza
|
|
|
|
|
import Network.Xmpp.Stream
|
|
|
|
|
import Network.Xmpp.Tls
|
|
|
|
|
import Network.Xmpp.Types
|