Permalink
Browse files

Apply minor Haddock changes

  • Loading branch information...
1 parent dd654e6 commit 2b1b1c8d00f026f90930273b7004092e1381d1fe @jonkri jonkri committed Feb 25, 2014
View
@@ -94,7 +94,7 @@ is the same as <code>Presence Nothing Nothing Nothing Nothing Available
[]</code>.
Now, let's say that we want to receive all message stanzas, and echo the stanzas
-back to the recipient. This can be done like so:
+back to the sender. This can be done like so:
forever $ do
msg <- getMessage sess
@@ -93,7 +93,7 @@ runHandler h session = h =<< atomically (readTMVar $ eventHandlers session)
-- | End the current XMPP session. Kills the associated threads and closes the
-- connection.
--
--- Note that XMPP clients (that has signalled availability) should send
+-- Note that XMPP clients (that have signalled availability) should send
-- \"Unavailable\" presence prior to disconnecting.
--
-- The connectionClosedHandler will not be called (to avoid possibly
@@ -30,7 +30,7 @@ data InstantMessage = InstantMessage { imThread :: Maybe MessageThread
, imBody :: [MessageBody]
}
--- | Empty instant message
+-- | Empty instant message.
instantMessage :: InstantMessage
instantMessage = InstantMessage { imThread = Nothing
, imSubject = []
@@ -49,7 +49,7 @@ sanitizeIM :: InstantMessage -> InstantMessage
sanitizeIM im = im{imBody = nubBy ((==) `on` bodyLang) $ imBody im}
-- | Append IM data to a message. Additional IM bodies with the same Langtag are
--- discarded
+-- discarded.
withIM :: Message -> InstantMessage -> Message
withIM m im = m{ messagePayload = messagePayload m
++ pickleTree xpIM (sanitizeIM im) }
@@ -65,11 +65,11 @@ simpleIM to bd = withIM message{messageTo = Just to}
instantMessage{imBody = [MessageBody Nothing bd]}
-- | Generate an answer from a received message. The recepient is
--- taken from the original sender, the sender is set to Nothing,
+-- 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
+-- Additional IM bodies with the same Langtag are discarded.
answerIM :: [MessageBody] -> Message -> Maybe Message
answerIM bd msg = case getIM msg of
Nothing -> Nothing
@@ -29,8 +29,8 @@ imPresence = IMP { showStatus = Nothing
instance Default IMPresence where
def = imPresence
--- | Try to extract RFC6121 IM presence information from presence stanza
--- Returns Nothing when the data is malformed, (Just IMPresence) otherwise
+-- | Try to extract RFC6121 IM presence information from presence stanza.
+-- Returns Nothing when the data is malformed, (Just IMPresence) otherwise.
getIMPresence :: Presence -> Maybe IMPresence
getIMPresence pres = case unpickle xpIMPresence (presencePayload pres) of
Left _ -> Nothing
@@ -32,15 +32,15 @@ timeout :: Maybe Integer
timeout = Just 3000000 -- 3 seconds
-- | Push a roster item to the server. The values for approved and ask are
--- ignored and all values for subsciption except "remove" are ignored
+-- ignored and all values for subsciption except "remove" are ignored.
rosterPush :: Item -> Session -> IO (Either IQSendError (Annotated IQResponse))
rosterPush item session = do
let el = pickleElem xpQuery (Query Nothing [fromItem item])
sendIQA' timeout Nothing Set Nothing el session
-- | Add or update an item to the roster.
--
--- To update the item just send the complete set of new data
+-- To update the item just send the complete set of new data.
rosterAdd :: Jid -- ^ JID of the item
-> Maybe Text -- ^ Name alias
-> [Text] -- ^ Groups (duplicates will be removed)
@@ -57,7 +57,7 @@ rosterAdd j n gs session = do
}])
sendIQA' timeout Nothing Set Nothing el session
--- | Remove an item from the roster. Return True when the item is sucessfully
+-- | 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.
rosterRemove :: Jid -> Session -> IO Bool
rosterRemove j sess = do
@@ -74,7 +74,8 @@ rosterRemove j sess = do
getRoster :: Session -> IO Roster
getRoster session = atomically $ readTVar (rosterRef session)
--- | Get the initial roster / refresh the roster. You don't need to call this on your own
+-- | Get the initial roster or refresh the roster. You don't need to call this
+-- on your own.
initRoster :: Session -> IO ()
initRoster session = do
oldRoster <- getRoster session
@@ -449,7 +449,7 @@ data StreamErrorCondition
-- than \"http://etherx.jabber.org/streams\" (see
-- Section 11.2) or the content namespace declared
-- as the default namespace is not supported (e.g.,
- -- something other than "jabber:client" or
+ -- something other than \"jabber:client\" or
-- \"jabber:server\").
| StreamInvalidXml -- ^ The entity has sent invalid XML over the stream to a
-- server that performs validation
@@ -474,8 +474,8 @@ data StreamErrorCondition
-- not to be used when the cause of the error
-- is within the administrative domain of the
-- XMPP service provider, in which case the
- -- <internal-server-error/> condition is more
- -- appropriate.
+ -- \<internal-server-error /\> condition is
+ -- more appropriate.
| StreamReset -- ^ The server is closing the stream because it has new
-- (typically security-critical) features to offer, because
-- the keys or certificates used to establish a secure context

0 comments on commit 2b1b1c8

Please sign in to comment.