Portability | portable |
---|---|
Stability | experimental |
Maintainer | Dmitry Astapov <dastapov@gmail.com>, pierre <k.pierre.k@gmail.com> |
Safe Haskell | Safe-Infered |
An XMPP stream: means to create and use one
- out :: XmppMessage -> XmppStateT ()
- startM :: XmppStateT [Attribute]
- nextM :: XmppStateT XmppMessage
- withNextM :: (XmppMessage -> b) -> StateT Stream IO b
- selectM :: (XmppMessage -> Bool) -> XmppStateT XmppMessage
- xtractM :: String -> XmppStateT [XmppMessage]
- textractM :: String -> XmppStateT String
- withSelectM :: (XmppMessage -> Bool) -> (XmppMessage -> b) -> StateT Stream IO b
- withNewStream :: XmppStateT a -> IO (a, Stream)
- withStream :: Stream -> XmppStateT a -> IO (a, Stream)
- resetStreamHandle :: (MonadIO m, MonadState Stream m) => Handle -> m ()
- getText :: Content i -> String
- getText_ :: [Content i] -> String
- loopWithPlugins :: [Plugin] -> XmppStateT ()
- data Plugin = Plugin {
- trigger :: String
- body :: XmppMessage -> XmppStateT ()
- getNextId :: XmppStateT Int
- lookupAttr :: String -> [Attribute] -> Maybe String
- newStream :: Stream
Documentation
out :: XmppMessage -> XmppStateT ()Source
Sends message into Stream
startM :: XmppStateT [Attribute]Source
startM is a special accessor case, since it has to retrieve only opening tag of the '<stream>' message,
which encloses the whole XMPP stream. That's why it does it's own parsing, and does not rely on nextM
nextM :: XmppStateT XmppMessageSource
Selects next messages from stream
selectM :: (XmppMessage -> Bool) -> XmppStateT XmppMessageSource
Selects next message matching predicate
xtractM :: String -> XmppStateT [XmppMessage]Source
Pass in xtract query, return query result from the first message where it returns non-empty results
withSelectM :: (XmppMessage -> Bool) -> (XmppMessage -> b) -> StateT Stream IO bSource
withNewStream :: XmppStateT a -> IO (a, Stream)Source
Convenience wrappers which allow for nicer code like: withNewStream $ do ...
withStream :: Stream -> XmppStateT a -> IO (a, Stream)Source
resetStreamHandle :: (MonadIO m, MonadState Stream m) => Handle -> m ()Source
Replaces contents of the Stream with the contents coming from given handle.
loopWithPlugins :: [Plugin] -> XmppStateT ()Source
Plugin | |
|