From d67869305ac83fcde6e4757acb99fd48e3bcf7f0 Mon Sep 17 00:00:00 2001
From: Philipp Balzarek
Date: Tue, 19 Nov 2013 16:51:32 +0100
Subject: [PATCH] remove payment-required stanza error condition and add
policy-violation condition instead
---
source/Network/Xmpp/Marshal.hs | 4 ++--
source/Network/Xmpp/Types.hs | 6 +++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/source/Network/Xmpp/Marshal.hs b/source/Network/Xmpp/Marshal.hs
index 29f668b..286d4e4 100644
--- a/source/Network/Xmpp/Marshal.hs
+++ b/source/Network/Xmpp/Marshal.hs
@@ -393,7 +393,7 @@ xpStanzaErrorCondition = ("xpStanzaErrorCondition", "") >
stanzaErrorConditionToText NotAcceptable = "not-acceptable"
stanzaErrorConditionToText NotAllowed = "not-allowed"
stanzaErrorConditionToText NotAuthorized = "not-authorized"
- stanzaErrorConditionToText PaymentRequired = "payment-required"
+ stanzaErrorConditionToText PolicyViolation = "policy-violation"
stanzaErrorConditionToText RecipientUnavailable = "recipient-unavailable"
stanzaErrorConditionToText (Redirect _) = "redirect"
stanzaErrorConditionToText RegistrationRequired = "registration-required"
@@ -415,7 +415,7 @@ xpStanzaErrorCondition = ("xpStanzaErrorCondition", "") >
stanzaErrorConditionFromText "not-acceptable" = Just NotAcceptable
stanzaErrorConditionFromText "not-allowed" = Just NotAllowed
stanzaErrorConditionFromText "not-authorized" = Just NotAuthorized
- stanzaErrorConditionFromText "payment-required" = Just PaymentRequired
+ stanzaErrorConditionFromText "policy-violation" = Just PolicyViolation
stanzaErrorConditionFromText "recipient-unavailable" = Just RecipientUnavailable
stanzaErrorConditionFromText "redirect" = Just $ Redirect Nothing
stanzaErrorConditionFromText "registration-required" = Just RegistrationRequired
diff --git a/source/Network/Xmpp/Types.hs b/source/Network/Xmpp/Types.hs
index 6b958ba..8981acf 100644
--- a/source/Network/Xmpp/Types.hs
+++ b/source/Network/Xmpp/Types.hs
@@ -301,7 +301,11 @@ data StanzaErrorCondition = BadRequest -- ^ Malformed XML.
-- this action.
| NotAuthorized -- ^ Must provide proper
-- credentials.
- | PaymentRequired
+ | PolicyViolation -- ^ The entity has violated
+ -- some local service policy
+ -- (e.g., a message contains
+ -- words that are prohibited
+ -- by the service)
| RecipientUnavailable -- ^ Temporarily unavailable.
| Redirect (Maybe Text) -- ^ Redirecting to other
-- entity, usually