pontarius-xmpp-0.4.2.1: An XMPP client library

Safe HaskellNone
LanguageHaskell98

Network.Xmpp.IM

Contents

Description

RFC 6121: Instant Messaging and Presence

Synopsis

Instant Messages

data InstantMessage Source

The instant message (IM) specific part of a message.

instantMessage :: InstantMessage Source

Empty instant message.

simpleIM Source

Arguments

:: Jid

recipient

-> Text

body

-> Message 

Generate a simple message

getIM :: Message -> Maybe InstantMessage Source

Get the IM specific parts of a message. Returns Nothing when the received payload is not valid IM data.

withIM :: Message -> InstantMessage -> Message Source

Append IM data to a message. Additional IM bodies with the same Langtag are discarded.

answerIM :: [MessageBody] -> Message -> Maybe Message Source

Generate an answer from a received message. The recepient is taken from the original sender, the sender is set to Nothing, message ID, language tag, message type as well as subject and thread are inherited.

Additional IM bodies with the same Langtag are discarded.

Presence

getIMPresence :: Presence -> Maybe IMPresence Source

Try to extract RFC6121 IM presence information from presence stanza. Returns Nothing when the data is malformed, (Just IMPresence) otherwise.

Roster

data Roster Source

Constructors

Roster 

Fields

ver :: Maybe Text
 
items :: Map Jid Item
 

Instances

data Item Source

Roster Items

Constructors

Item 

Instances

getRoster :: Session -> IO Roster Source

Retrieve the current Roster state

getRosterSTM :: Session -> STM Roster Source

Retrieve the current Roster state (STM version)

rosterAdd :: Jid -> Maybe Text -> [Text] -> Session -> IO (Either IQSendError (Annotated IQResponse)) Source

Synonym to rosterSet

rosterRemove :: Jid -> Session -> IO Bool Source

Remove an item from the roster. Return True when the item is sucessfully removed or if it wasn't in the roster to begin with.

presenceTracker

isPeerAvailable :: Jid -> Session -> STM Bool Source

Check whether a given jid is available

getEntityStatus :: Jid -> Session -> STM PeerStatus Source

Get status of given full JID

getAvailablePeers :: Session -> STM [Jid] Source

Get list of (bare) Jids with available entities

getPeerEntities :: Jid -> Session -> STM (Map Jid (Maybe IMPresence)) Source

Get all available full JIDs to the given JID