Safe Haskell | None |
---|---|
Language | Haskell98 |
Network.Xmpp.IM
Description
RFC 6121: Instant Messaging and Presence
- data InstantMessage = InstantMessage {
- imThread :: Maybe MessageThread
- imSubject :: [MessageSubject]
- imBody :: [MessageBody]
- data MessageBody = MessageBody {
- bodyLang :: Maybe LangTag
- bodyContent :: Text
- data MessageThread = MessageThread {
- threadID :: Text
- threadParent :: Maybe Text
- data MessageSubject = MessageSubject {}
- data Subscription
- instantMessage :: InstantMessage
- simpleIM :: Jid -> Text -> Message
- getIM :: Message -> Maybe InstantMessage
- withIM :: Message -> InstantMessage -> Message
- answerIM :: [MessageBody] -> Message -> Maybe Message
- data ShowStatus
- data IMPresence = IMP {
- showStatus :: Maybe ShowStatus
- status :: Maybe Text
- priority :: Maybe Int
- imPresence :: IMPresence
- getIMPresence :: Presence -> Maybe IMPresence
- withIMPresence :: IMPresence -> Presence -> Presence
- data Roster = Roster {}
- data Item = Item {
- riApproved :: Bool
- riAsk :: Bool
- riJid :: Jid
- riName :: Maybe Text
- riSubscription :: Subscription
- riGroups :: [Text]
- getRoster :: Session -> IO Roster
- getRosterSTM :: Session -> STM Roster
- rosterAdd :: Jid -> Maybe Text -> [Text] -> Session -> IO (Either IQSendError (Annotated IQResponse))
- rosterRemove :: Jid -> Session -> IO Bool
- data PeerStatus
- isPeerAvailable :: Jid -> Session -> STM Bool
- getEntityStatus :: Jid -> Session -> STM PeerStatus
- getAvailablePeers :: Session -> STM [Jid]
- getPeerEntities :: Jid -> Session -> STM (Map Jid (Maybe IMPresence))
Instant Messages
data InstantMessage Source
The instant message (IM) specific part of a message.
Constructors
InstantMessage | |
Fields
|
Instances
data MessageBody Source
Constructors
MessageBody | |
Fields
|
data MessageThread Source
Constructors
MessageThread | |
Fields
|
data MessageSubject Source
Constructors
MessageSubject | |
Fields |
data Subscription Source
Instances
instantMessage :: InstantMessage Source
Empty instant 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
data IMPresence Source
Constructors
IMP | |
Fields
|
Instances
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.
withIMPresence :: IMPresence -> Presence -> Presence Source
Roster
Roster Items
Constructors
Item | |
Fields
|
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
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