diff --git a/source/Network/Xmpp/Marshal.hs b/source/Network/Xmpp/Marshal.hs index ff893da..da7dbd0 100644 --- a/source/Network/Xmpp/Marshal.hs +++ b/source/Network/Xmpp/Marshal.hs @@ -277,4 +277,4 @@ xpJid :: PU Text Jid xpJid = PU { unpickleTree = \input -> case jidFromText input of Nothing -> UnpickleError $ ErrorMessage "Could not parse JID." Just jid -> Result jid Nothing - , pickleTree = \input -> pack $ jidToText input } + , pickleTree = \input -> jidToText input } diff --git a/source/Network/Xmpp/Types.hs b/source/Network/Xmpp/Types.hs index dea21e7..45999cd 100644 --- a/source/Network/Xmpp/Types.hs +++ b/source/Network/Xmpp/Types.hs @@ -936,9 +936,6 @@ parseJid s = case jidFromText $ Text.pack s of Just jid -> jid Nothing -> error $ "Jid value (" ++ s ++ ") did not validate" -instance IsString Jid where - fromString = fromJust . jidFromText . Text.pack - -- | Converts a Text to a JID. jidFromText :: Text -> Maybe Jid jidFromText t = do diff --git a/tests/Tests.hs b/tests/Tests.hs index ba7dadb..41f334a 100644 --- a/tests/Tests.hs +++ b/tests/Tests.hs @@ -28,13 +28,13 @@ import System.Environment import System.Log.Logger testUser1 :: Jid -testUser1 = "echo1@species64739.dyndns.org/bot" +testUser1 = parseJid "echo1@species64739.dyndns.org/bot" testUser2 :: Jid -testUser2 = "echo2@species64739.dyndns.org/bot" +testUser2 = parseJid "echo2@species64739.dyndns.org/bot" supervisor :: Jid -supervisor = "uart14@species64739.dyndns.org" +supervisor = parseJid "uart14@species64739.dyndns.org" config = def{sessionStreamConfiguration = def{connectionDetails = UseHost "localhost" (PortNumber 5222)}}