Safe Haskell | None |
---|---|
Language | Haskell98 |
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.
InstantMessage | |
|
data MessageBody Source #
data MessageThread Source #
data Subscription Source #
None | the user does not have a subscription to the contact's presence information, and the contact does not have a subscription to the user's presence information |
To | the user has a subscription to the contact's presence information, but the contact does not have a subscription to the user's presence information |
From | the contact has a subscription to the user's presence information, but the user does not have a subscription to the contact's presence information |
Both | both the user and the contact have subscriptions to each other's presence information |
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 ShowStatus Source #
data IMPresence Source #
IMP | |
|
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
Item | |
|
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
data PeerStatus Source #
getEntityStatus :: Jid -> Session -> STM PeerStatus Source #
Get status of given full JID
getPeerEntities :: Jid -> Session -> STM (Map Jid (Maybe IMPresence)) Source #
Get all available full JIDs to the given JID