Copyright | (c) Dmitry Astapov 2006 ; pierre 2007 |
---|---|
License | BSD3 |
Maintainer | Dmitry Astapov <dastapov@gmail.com>, pierre <k.pierre.k@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
An XMPP stream: means to create and use one
Synopsis
- class XmppSendable t a where
- data Plugin = Plugin {}
- data XmppError
- startM :: MonadIO m => XmppMonad m (Either XmppError [Attribute])
- nextM :: MonadIO m => XmppMonad m (Either XmppError (Content Posn))
- withNextM :: MonadIO m => (Content Posn -> b) -> XmppMonad m (Either XmppError b)
- selectM :: MonadIO m => (Content Posn -> Bool) -> XmppMonad m (Either XmppError (Content Posn))
- xtractM :: MonadIO m => Text -> XmppMonad m [Content Posn]
- textractM :: MonadIO m => Text -> XmppMonad m Text
- withSelectM :: MonadIO m => (Content Posn -> Bool) -> (Content Posn -> b) -> XmppMonad m (Either XmppError b)
- resetStreamHandle :: (MonadIO m, MonadState Stream m) => Handle -> m ()
- getText :: Content i -> Text
- getText_ :: [Content i] -> Text
- loopWithPlugins :: [Plugin] -> XmppMonad IO (Either Text ())
- getNextId :: MonadIO m => XmppMonad m Int
- parse :: forall l e. (Alternative l, FromXML e) => Content Posn -> l (SomeStanza e)
- parseM :: (FromXML e, MonadIO m) => XmppMonad m (Either XmppError (SomeStanza e))
- waitAndProcess :: (FromXML e, MonadIO m) => (SomeStanza e -> Maybe a) -> XmppMonad m (Either XmppError a)
- withUUID :: MonadIO m => (UUID -> Stanza t p e) -> m (Stanza t p e)
Documentation
class XmppSendable t a where Source #
Sends message into Stream
StreamClosedError | |
MessageParseError Text Text | |
NonSupportedAuthMechanisms [Text] Text | |
AuthError Text | |
RanOutOfInput | |
UnknownVersion Text | |
UnknownError Text |
Instances
nextM :: MonadIO m => XmppMonad m (Either XmppError (Content Posn)) Source #
Selects next messages from stream
selectM :: MonadIO m => (Content Posn -> Bool) -> XmppMonad m (Either XmppError (Content Posn)) Source #
Selects next message matching predicate
xtractM :: MonadIO m => Text -> XmppMonad m [Content Posn] Source #
Pass in xtract query, return query result from the first message where it returns non-empty results
withSelectM :: MonadIO m => (Content Posn -> Bool) -> (Content Posn -> b) -> XmppMonad m (Either XmppError b) Source #
resetStreamHandle :: (MonadIO m, MonadState Stream m) => Handle -> m () Source #
Replaces contents of the Stream with the contents coming from given handle.
parse :: forall l e. (Alternative l, FromXML e) => Content Posn -> l (SomeStanza e) Source #
Parses XML element producing Stanza
parseM :: (FromXML e, MonadIO m) => XmppMonad m (Either XmppError (SomeStanza e)) Source #
Gets next message from stream and parses it | We shall skip over unknown messages, rather than crashing