Safe Haskell | None |
---|
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
- = StatusAway
- | StatusChat
- | StatusDnd
- | StatusXa
- 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
- rosterAdd :: Jid -> Maybe Text -> [Text] -> Session -> IO (Maybe IQResponse)
- rosterRemove :: Jid -> Session -> IO Bool
Instant Messages
data InstantMessage Source
The instant message (IM) specific part of a message.
InstantMessage | |
|
data MessageBody Source
data MessageThread Source
getIM :: Message -> Maybe InstantMessageSource
Get the IM specific parts of a message. Returns Nothing
when the received
payload is not valid IM data.
withIM :: Message -> InstantMessage -> MessageSource
Append IM data to a message
answerIM :: [MessageBody] -> Message -> Maybe MessageSource
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, the remaining payload is replaced by the given one.
If multiple message bodies are given they MUST have different language tags
Presence
data IMPresence Source
IMP | |
|
getIMPresence :: Presence -> Maybe IMPresenceSource
Try to extract RFC6121 IM presence information from presence stanza Returns Nothing when the data is malformed, (Just IMPresence) otherwise
withIMPresence :: IMPresence -> Presence -> PresenceSource
Roster
Roster Items
Item | |
|