Safe Haskell | None |
---|---|
Language | Haskell98 |
RFC 6121: Instant Messaging and Presence
Synopsis
- 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]
- data RosterUpdate
- 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 | |
|
Instances
Default InstantMessage Source # | |
Defined in Network.Xmpp.IM.Message def :: 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 |
Instances
Eq Subscription Source # | |
Defined in Network.Xmpp.IM.Roster.Types (==) :: Subscription -> Subscription -> Bool # (/=) :: Subscription -> Subscription -> Bool # | |
Read Subscription Source # | |
Defined in Network.Xmpp.IM.Roster.Types readsPrec :: Int -> ReadS Subscription # readList :: ReadS [Subscription] # | |
Show Subscription Source # | |
Defined in Network.Xmpp.IM.Roster.Types showsPrec :: Int -> Subscription -> ShowS # show :: Subscription -> String # showList :: [Subscription] -> ShowS # |
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 #
Instances
Eq ShowStatus Source # | |
Defined in Network.Xmpp.IM.Presence (==) :: ShowStatus -> ShowStatus -> Bool # (/=) :: ShowStatus -> ShowStatus -> Bool # | |
Read ShowStatus Source # | |
Defined in Network.Xmpp.IM.Presence readsPrec :: Int -> ReadS ShowStatus # readList :: ReadS [ShowStatus] # readPrec :: ReadPrec ShowStatus # readListPrec :: ReadPrec [ShowStatus] # | |
Show ShowStatus Source # | |
Defined in Network.Xmpp.IM.Presence showsPrec :: Int -> ShowStatus -> ShowS # show :: ShowStatus -> String # showList :: [ShowStatus] -> ShowS # |
data IMPresence Source #
IMP | |
|
Instances
Eq IMPresence Source # | |
Defined in Network.Xmpp.IM.Presence (==) :: IMPresence -> IMPresence -> Bool # (/=) :: IMPresence -> IMPresence -> Bool # | |
Show IMPresence Source # | |
Defined in Network.Xmpp.IM.Presence showsPrec :: Int -> IMPresence -> ShowS # show :: IMPresence -> String # showList :: [IMPresence] -> ShowS # | |
Default IMPresence Source # | |
Defined in Network.Xmpp.IM.Presence def :: IMPresence # |
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 | |
|
data RosterUpdate Source #
RosterUpdateRemove Jid | |
RosterUpdateAdd Item | New or updated item |
Instances
Show RosterUpdate Source # | |
Defined in Network.Xmpp.IM.Roster.Types showsPrec :: Int -> RosterUpdate -> ShowS # show :: RosterUpdate -> String # showList :: [RosterUpdate] -> ShowS # |
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 #
Instances
Eq PeerStatus Source # | |
Defined in Network.Xmpp.IM.PresenceTracker.Types (==) :: PeerStatus -> PeerStatus -> Bool # (/=) :: PeerStatus -> PeerStatus -> Bool # | |
Show PeerStatus Source # | |
Defined in Network.Xmpp.IM.PresenceTracker.Types showsPrec :: Int -> PeerStatus -> ShowS # show :: PeerStatus -> String # showList :: [PeerStatus] -> ShowS # |
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