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
- rosterAdd :: Jid -> Maybe Text -> [Text] -> Session -> IO (Either IQSendError (Annotated 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
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
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 | |
|
:: 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.