Safe Haskell | None |
---|---|
Language | Haskell98 |
Network.Protocol.XMPP
Synopsis
- data JID = JID {}
- data Node
- data Domain
- data Resource
- strNode :: Node -> Text
- strDomain :: Domain -> Text
- strResource :: Resource -> Text
- parseJID :: Text -> Maybe JID
- formatJID :: JID -> Text
- class Stanza a where
- stanzaTo :: a -> Maybe JID
- stanzaFrom :: a -> Maybe JID
- stanzaID :: a -> Maybe Text
- stanzaLang :: a -> Maybe Text
- stanzaPayloads :: a -> [Element]
- data ReceivedStanza
- data Message = Message {
- messageType :: MessageType
- messageTo :: Maybe JID
- messageFrom :: Maybe JID
- messageID :: Maybe Text
- messageLang :: Maybe Text
- messagePayloads :: [Element]
- data Presence = Presence {}
- data IQ = IQ {}
- data MessageType
- data PresenceType
- data IQType
- emptyMessage :: MessageType -> Message
- emptyPresence :: PresenceType -> Presence
- emptyIQ :: IQType -> IQ
- data XMPP a
- data Server = Server {
- serverJID :: JID
- serverHostname :: HostName
- serverPort :: PortID
- data Error
- runClient :: Server -> JID -> Text -> Text -> XMPP a -> IO (Either Error a)
- runComponent :: Server -> Text -> XMPP a -> IO (Either Error a)
- putStanza :: Stanza a => a -> XMPP ()
- getStanza :: XMPP ReceivedStanza
- bindJID :: JID -> XMPP JID
- data Session
- getSession :: XMPP Session
- sessionIsSecure :: XMPP Bool
- runXMPP :: Session -> XMPP a -> IO (Either Error a)
JIDs
strResource :: Resource -> Text Source #
Stanzas
Minimal complete definition
stanzaTo, stanzaFrom, stanzaID, stanzaLang, stanzaPayloads, stanzaToElement
Methods
stanzaTo :: a -> Maybe JID Source #
stanzaFrom :: a -> Maybe JID Source #
stanzaID :: a -> Maybe Text Source #
stanzaLang :: a -> Maybe Text Source #
stanzaPayloads :: a -> [Element] Source #
data ReceivedStanza Source #
Constructors
ReceivedMessage Message | |
ReceivedPresence Presence | |
ReceivedIQ IQ |
Instances
Show ReceivedStanza Source # | |
Defined in Network.Protocol.XMPP.Stanza |
Constructors
Message | |
Fields
|
Constructors
Presence | |
Fields
|
data MessageType Source #
Instances
Eq MessageType Source # | |
Defined in Network.Protocol.XMPP.Stanza Methods (==) :: MessageType -> MessageType -> Bool Source # (/=) :: MessageType -> MessageType -> Bool Source # | |
Show MessageType Source # | |
Defined in Network.Protocol.XMPP.Stanza |
data PresenceType Source #
Constructors
PresenceAvailable | |
PresenceUnavailable | |
PresenceSubscribe | |
PresenceSubscribed | |
PresenceUnsubscribe | |
PresenceUnsubscribed | |
PresenceProbe | |
PresenceError |
Instances
Eq PresenceType Source # | |
Defined in Network.Protocol.XMPP.Stanza Methods (==) :: PresenceType -> PresenceType -> Bool Source # (/=) :: PresenceType -> PresenceType -> Bool Source # | |
Show PresenceType Source # | |
Defined in Network.Protocol.XMPP.Stanza |
emptyMessage :: MessageType -> Message Source #
emptyPresence :: PresenceType -> Presence Source #
The XMPP monad
Constructors
Server | |
Fields
|
Constructors
AuthenticationFailure Element | The remote host refused the specified authentication credentials. The included XML element is the error value that the server provided. It may contain additional information about why authentication failed. |
AuthenticationError Text | There was an error while authenticating with the remote host. |
InvalidStanza Element | An unrecognized or malformed |
InvalidBindResult ReceivedStanza | The remote host sent an invalid reply to a resource bind request. |
TransportError Text | There was an error with the underlying transport. |
NoComponentStreamID | The remote host did not send a stream ID when accepting a component connection. |
Resuming sessions
getSession :: XMPP Session Source #