| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.Xmpp.IM
Description
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.
Constructors
| InstantMessage | |
Fields
| |
Instances
| Default InstantMessage Source # | |
Defined in Network.Xmpp.IM.Message Methods def :: InstantMessage # | |
data MessageBody Source #
Constructors
| MessageBody | |
Fields
| |
data MessageThread Source #
Constructors
| MessageThread | |
Fields
| |
data MessageSubject Source #
Constructors
| MessageSubject | |
Fields | |
data Subscription Source #
Constructors
| 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
| Read Subscription Source # | |
Defined in Network.Xmpp.IM.Roster.Types Methods readsPrec :: Int -> ReadS Subscription # readList :: ReadS [Subscription] # | |
| Show Subscription Source # | |
Defined in Network.Xmpp.IM.Roster.Types Methods showsPrec :: Int -> Subscription -> ShowS # show :: Subscription -> String # showList :: [Subscription] -> ShowS # | |
| Eq Subscription Source # | |
Defined in Network.Xmpp.IM.Roster.Types | |
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 #
Constructors
| StatusAway | |
| StatusChat | |
| StatusDnd | |
| StatusXa |
Instances
| Read ShowStatus Source # | |
Defined in Network.Xmpp.IM.Presence Methods readsPrec :: Int -> ReadS ShowStatus # readList :: ReadS [ShowStatus] # readPrec :: ReadPrec ShowStatus # readListPrec :: ReadPrec [ShowStatus] # | |
| Show ShowStatus Source # | |
Defined in Network.Xmpp.IM.Presence Methods showsPrec :: Int -> ShowStatus -> ShowS # show :: ShowStatus -> String # showList :: [ShowStatus] -> ShowS # | |
| Eq ShowStatus Source # | |
Defined in Network.Xmpp.IM.Presence | |
data IMPresence Source #
Constructors
| IMP | |
Fields
| |
Instances
| Show IMPresence Source # | |
Defined in Network.Xmpp.IM.Presence Methods showsPrec :: Int -> IMPresence -> ShowS # show :: IMPresence -> String # showList :: [IMPresence] -> ShowS # | |
| Default IMPresence Source # | |
Defined in Network.Xmpp.IM.Presence Methods def :: IMPresence # | |
| Eq IMPresence Source # | |
Defined in Network.Xmpp.IM.Presence | |
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
| |
data RosterUpdate Source #
Constructors
| RosterUpdateRemove Jid | |
| RosterUpdateAdd Item | New or updated item |
Instances
| Show RosterUpdate Source # | |
Defined in Network.Xmpp.IM.Roster.Types Methods 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 #
Constructors
| PeerAvailable (Maybe IMPresence) | |
| PeerUnavailable |
Instances
| Show PeerStatus Source # | |
Defined in Network.Xmpp.IM.PresenceTracker.Types Methods showsPrec :: Int -> PeerStatus -> ShowS # show :: PeerStatus -> String # showList :: [PeerStatus] -> ShowS # | |
| Eq PeerStatus Source # | |
Defined in Network.Xmpp.IM.PresenceTracker.Types | |
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