From 8f00c6f7d934d80035b3e38b1f7d60ad54ee7d63 Mon Sep 17 00:00:00 2001 From: Jon Kristensen Date: Sat, 1 Jun 2013 22:31:23 +0200 Subject: [PATCH] Provide access to StanzaID generator in Network.Xmpp (`newStanzaID') Fixes #22. --- source/Network/Xmpp.hs | 1 + source/Network/Xmpp/Concurrent.hs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/source/Network/Xmpp.hs b/source/Network/Xmpp.hs index 28ceb44..e92579b 100644 --- a/source/Network/Xmpp.hs +++ b/source/Network/Xmpp.hs @@ -83,6 +83,7 @@ module Network.Xmpp -- or IQ stanza. , getStanza , getStanzaChan + , newStanzaID -- ** Messages -- | The /message/ stanza is a /push/ mechanism whereby one entity -- pushes information to another entity, similar to the communications that diff --git a/source/Network/Xmpp/Concurrent.hs b/source/Network/Xmpp/Concurrent.hs index b883fef..0ba3035 100644 --- a/source/Network/Xmpp/Concurrent.hs +++ b/source/Network/Xmpp/Concurrent.hs @@ -12,6 +12,7 @@ module Network.Xmpp.Concurrent , newSession , writeWorker , session + , newStanzaID ) where import Control.Applicative((<$>),(<*>)) @@ -182,3 +183,7 @@ session realm mbSasl config = runErrorT $ do ses <- ErrorT $ newSession stream config liftIO $ when (enableRoster config) $ initRoster ses return ses + +newStanzaID :: Session -> IO StanzaID +newStanzaID = idGenerator +