From 3161404679e3c99af3d38e63f3318081d33a2634 Mon Sep 17 00:00:00 2001
From: Philipp Balzarek
Date: Wed, 13 Jun 2012 18:18:06 +0200
Subject: [PATCH] clean up Types
---
source/Network/Xmpp/Bind.hs | 2 +-
source/Network/Xmpp/Types.hs | 39 ------------------------------------
2 files changed, 1 insertion(+), 40 deletions(-)
diff --git a/source/Network/Xmpp/Bind.hs b/source/Network/Xmpp/Bind.hs
index cebec16..8963de5 100644
--- a/source/Network/Xmpp/Bind.hs
+++ b/source/Network/Xmpp/Bind.hs
@@ -35,7 +35,7 @@ xmppBind rsrc = do
, Right jid <- unpickleElem jidP b
-> return jid
| otherwise -> throw $ StreamXMLError
- "Bind could'nt unpickle JID"
+ "Bind couldn't unpickle JID"
modify (\s -> s{sJid = Just jid})
return jid
where
diff --git a/source/Network/Xmpp/Types.hs b/source/Network/Xmpp/Types.hs
index a407983..0dcd4ee 100644
--- a/source/Network/Xmpp/Types.hs
+++ b/source/Network/Xmpp/Types.hs
@@ -23,7 +23,6 @@ module Network.Xmpp.Types
, SaslError(..)
, SaslFailure(..)
, SaslMechanism (..)
- , SaslCredentials (..)
, ServerFeatures(..)
, Stanza(..)
, StanzaError(..)
@@ -253,31 +252,6 @@ instance Read PresenceType where
readsPrec _ "probe" = [(Probe, "")]
readsPrec _ _ = []
---data ShowType = Available
--- | Away
--- | FreeChat
--- | DND
--- | XAway
--- deriving Eq
---
---instance Show ShowType where
--- show Available = ""
--- show Away = "away"
--- show FreeChat = "chat"
--- show DND = "dnd"
--- show XAway = "xa"
---
---instance Read ShowType where
--- readsPrec _ "" = [( Available ,"")]
--- readsPrec _ "available" = [( Available ,"")]
--- readsPrec _ "away" = [( Away ,"")]
--- readsPrec _ "chat" = [( FreeChat ,"")]
--- readsPrec _ "dnd" = [( DND ,"")]
--- readsPrec _ "xa" = [( XAway ,"")]
--- readsPrec _ "invisible" = [( Available ,"")]
--- readsPrec _ _ = []
-
-
-- | All stanzas (IQ, message, presence) can cause errors, which in the Xmpp
-- stream looks like . These errors are
-- wrapped in the @StanzaError@ type.
@@ -402,17 +376,6 @@ instance Read StanzaErrorCondition where
-- OTHER STUFF
-- =============================================================================
-data SaslCredentials = DigestMD5Credentials (Maybe Text) Text Text
- | PlainCredentials (Maybe Text) Text Text
-
-instance Show SaslCredentials where
- show (DigestMD5Credentials authzid authcid _) = "DIGEST_MD5Credentials " ++
- (Text.unpack $ fromMaybe "" authzid) ++ " " ++ (Text.unpack authcid) ++
- " (password hidden)"
- show (PlainCredentials authzid authcid _) = "PLAINCredentials " ++
- (Text.unpack $ fromMaybe "" authzid) ++ " " ++ (Text.unpack authcid) ++
- " (password hidden)"
-
data SaslMechanism = DigestMD5 deriving Show
data SaslFailure = SaslFailure { saslFailureCondition :: SaslError
@@ -476,8 +439,6 @@ instance Read SaslError where
readsPrec _ "temporary-auth-failure" = [(SaslTemporaryAuthFailure , "")]
readsPrec _ _ = []
--- data ServerAddress = ServerAddress N.HostName N.PortNumber deriving (Eq)
-
-- TODO: document the error cases
data StreamErrorCondition
= StreamBadFormat