pontarius-xmpp-0.4.0.2: 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

rosterAdd Source

Arguments

:: Jid

JID of the item

-> Maybe Text

Name alias

-> [Text]

Groups (duplicates will be removed)

-> Session 
-> IO (Either IQSendError (Annotated IQResponse)) 

Add or update an item to the roster.

To update the item just send the complete set of new data.

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.