Browse Source

Export StanzaID; rename StanzaId constructor

master
Jon Kristensen 13 years ago
parent
commit
11f2f73a91
  1. 1
      source/Network/Xmpp/Internal.hs
  2. 10
      source/Network/Xmpp/Types.hs

1
source/Network/Xmpp/Internal.hs

@ -43,6 +43,7 @@ module Network.Xmpp.Internal
, pullFinalMessage , pullFinalMessage
, Pairs(..) , Pairs(..)
, quote , quote
, StanzaId(..)
) )
where where

10
source/Network/Xmpp/Types.hs

@ -81,18 +81,18 @@ import qualified Text.StringPrep as SP
-- | -- |
-- Wraps a string of random characters that, when using an appropriate -- Wraps a string of random characters that, when using an appropriate
-- @IDGenerator@, is guaranteed to be unique for the Xmpp session. -- @IdGenerator@, is guaranteed to be unique for the Xmpp session.
data StanzaId = SI !Text deriving (Eq, Ord) data StanzaId = StanzaId !Text deriving (Eq, Ord)
instance Show StanzaId where instance Show StanzaId where
show (SI s) = Text.unpack s show (StanzaId s) = Text.unpack s
instance Read StanzaId where instance Read StanzaId where
readsPrec _ x = [(SI $ Text.pack x, "")] readsPrec _ x = [(StanzaId $ Text.pack x, "")]
instance IsString StanzaId where instance IsString StanzaId where
fromString = SI . Text.pack fromString = StanzaId . Text.pack
-- | The Xmpp communication primities (Message, Presence and Info/Query) are -- | The Xmpp communication primities (Message, Presence and Info/Query) are
-- called stanzas. -- called stanzas.

Loading…
Cancel
Save