From 7f2146025cfa2793b1b55d86d564e36576980d59 Mon Sep 17 00:00:00 2001 From: Jon Kristensen Date: Mon, 26 Aug 2013 13:30:21 +0200 Subject: [PATCH] Clear Haddock warnings, create jidQ and newStanzaID Haddock --- source/Network/Xmpp/Concurrent.hs | 3 ++- source/Network/Xmpp/Stream.hs | 6 +++--- source/Network/Xmpp/Types.hs | 13 +++++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/source/Network/Xmpp/Concurrent.hs b/source/Network/Xmpp/Concurrent.hs index 72d5525..fa1d239 100644 --- a/source/Network/Xmpp/Concurrent.hs +++ b/source/Network/Xmpp/Concurrent.hs @@ -283,6 +283,7 @@ doRetry sess@Session{reconnectWait = rw} = do threadDelay $ t * 10^(6 :: Int) reconnectNow sess - +-- | Generates a new stanza identifier based on the 'sessionStanzaIDs' field of +-- 'SessionConfiguration'. newStanzaID :: Session -> IO Text newStanzaID = idGenerator diff --git a/source/Network/Xmpp/Stream.hs b/source/Network/Xmpp/Stream.hs index 38c145f..4fad0f2 100644 --- a/source/Network/Xmpp/Stream.hs +++ b/source/Network/Xmpp/Stream.hs @@ -327,9 +327,9 @@ openStream realm config = runErrorT $ do ErrorT . liftIO $ withStream startStream stream' return stream' --- | Send "" and wait for the server to finish processing and to --- close the connection. Any remaining elements from the server are returned. --- Surpresses StreamEndFailure exceptions, but may throw a StreamCloseError. +-- | Send \"\" and wait for the server to finish processing and +-- to close the connection. Any remaining elements from the server are returned. +-- Surpresses 'StreamEndFailure' exceptions, but may throw a 'StreamCloseError'. closeStreams :: Stream -> IO () closeStreams = withStream closeStreams' diff --git a/source/Network/Xmpp/Types.hs b/source/Network/Xmpp/Types.hs index f37b04b..e342dd6 100644 --- a/source/Network/Xmpp/Types.hs +++ b/source/Network/Xmpp/Types.hs @@ -79,7 +79,6 @@ import qualified Data.ByteString as BS import Data.Conduit import Data.Default import qualified Data.Set as Set -import Data.String (IsString(..)) import Data.Text (Text) import qualified Data.Text as Text import Data.Typeable(Typeable) @@ -392,11 +391,11 @@ data StreamErrorCondition -- Server Dialback, or (2) between a client and a server -- via SASL authentication and resource binding. | StreamInvalidNamespace -- ^ The stream namespace name is something other - -- than "http://etherx.jabber.org/streams" (see + -- 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 - -- "jabber:server"). + -- \"jabber:server\"). | StreamInvalidXml -- ^ The entity has sent invalid XML over the stream to a -- server that performs validation | StreamNotAuthorized -- ^ The entity has attempted to send XML stanzas or @@ -541,7 +540,7 @@ instance Error AuthFailure where -- XML TYPES -- ============================================================================= --- | XMPP version number. Displayed as ".". 2.4 is lesser than +-- | XMPP version number. Displayed as "\.\". 2.4 is lesser than -- 2.13, which in turn is lesser than 12.3. data Version = Version { majorVersion :: !Integer @@ -756,6 +755,12 @@ instance Read Jid where -- or the `parseJid' error message (see below) #if WITH_TEMPLATE_HASKELL +-- | Constructs a @Jid@ value at compile time. +-- +-- Syntax: +-- @ +-- [jidQ|localpart\@domainpart/resourcepart|] +-- @ jidQ :: QuasiQuoter jidQ = QuasiQuoter { quoteExp = \s -> do when (head s == ' ') . fail $ "Leading whitespaces in JID" ++ show s