|
|
|
@ -156,9 +156,7 @@ xpStanzaErrorCondition = ("xpErrorCondition" , "") <?+> xpWrapEither |
|
|
|
-- the optional field is left empty and must be filled in by the caller |
|
|
|
-- the optional field is left empty and must be filled in by the caller |
|
|
|
xpStanzaErrorConditionShape :: PU Text StanzaErrorCondition |
|
|
|
xpStanzaErrorConditionShape :: PU Text StanzaErrorCondition |
|
|
|
xpStanzaErrorConditionShape = ("xpStanzaErrorCondition", "") <?> |
|
|
|
xpStanzaErrorConditionShape = ("xpStanzaErrorCondition", "") <?> |
|
|
|
xpPartial ( \input -> case stanzaErrorConditionFromText input of |
|
|
|
xpIso stanzaErrorConditionFromText |
|
|
|
Nothing -> Left "Could not parse stanza error condition." |
|
|
|
|
|
|
|
Just j -> Right j) |
|
|
|
|
|
|
|
stanzaErrorConditionToText |
|
|
|
stanzaErrorConditionToText |
|
|
|
stanzaErrorConditionToText BadRequest = "bad-request" |
|
|
|
stanzaErrorConditionToText BadRequest = "bad-request" |
|
|
|
stanzaErrorConditionToText Conflict = "conflict" |
|
|
|
stanzaErrorConditionToText Conflict = "conflict" |
|
|
|
@ -182,29 +180,29 @@ xpStanzaErrorCondition = ("xpErrorCondition" , "") <?+> xpWrapEither |
|
|
|
stanzaErrorConditionToText SubscriptionRequired = "subscription-required" |
|
|
|
stanzaErrorConditionToText SubscriptionRequired = "subscription-required" |
|
|
|
stanzaErrorConditionToText UndefinedCondition = "undefined-condition" |
|
|
|
stanzaErrorConditionToText UndefinedCondition = "undefined-condition" |
|
|
|
stanzaErrorConditionToText UnexpectedRequest = "unexpected-request" |
|
|
|
stanzaErrorConditionToText UnexpectedRequest = "unexpected-request" |
|
|
|
stanzaErrorConditionFromText "bad-request" = Just BadRequest |
|
|
|
stanzaErrorConditionFromText "bad-request" = BadRequest |
|
|
|
stanzaErrorConditionFromText "conflict" = Just Conflict |
|
|
|
stanzaErrorConditionFromText "conflict" = Conflict |
|
|
|
stanzaErrorConditionFromText "feature-not-implemented" = Just FeatureNotImplemented |
|
|
|
stanzaErrorConditionFromText "feature-not-implemented" = FeatureNotImplemented |
|
|
|
stanzaErrorConditionFromText "forbidden" = Just Forbidden |
|
|
|
stanzaErrorConditionFromText "forbidden" = Forbidden |
|
|
|
stanzaErrorConditionFromText "gone" = Just $ Gone Nothing |
|
|
|
stanzaErrorConditionFromText "gone" = Gone Nothing |
|
|
|
stanzaErrorConditionFromText "internal-server-error" = Just InternalServerError |
|
|
|
stanzaErrorConditionFromText "internal-server-error" = InternalServerError |
|
|
|
stanzaErrorConditionFromText "item-not-found" = Just ItemNotFound |
|
|
|
stanzaErrorConditionFromText "item-not-found" = ItemNotFound |
|
|
|
stanzaErrorConditionFromText "jid-malformed" = Just JidMalformed |
|
|
|
stanzaErrorConditionFromText "jid-malformed" = JidMalformed |
|
|
|
stanzaErrorConditionFromText "not-acceptable" = Just NotAcceptable |
|
|
|
stanzaErrorConditionFromText "not-acceptable" = NotAcceptable |
|
|
|
stanzaErrorConditionFromText "not-allowed" = Just NotAllowed |
|
|
|
stanzaErrorConditionFromText "not-allowed" = NotAllowed |
|
|
|
stanzaErrorConditionFromText "not-authorized" = Just NotAuthorized |
|
|
|
stanzaErrorConditionFromText "not-authorized" = NotAuthorized |
|
|
|
stanzaErrorConditionFromText "policy-violation" = Just PolicyViolation |
|
|
|
stanzaErrorConditionFromText "policy-violation" = PolicyViolation |
|
|
|
stanzaErrorConditionFromText "recipient-unavailable" = Just RecipientUnavailable |
|
|
|
stanzaErrorConditionFromText "recipient-unavailable" = RecipientUnavailable |
|
|
|
stanzaErrorConditionFromText "redirect" = Just $ Redirect Nothing |
|
|
|
stanzaErrorConditionFromText "redirect" = Redirect Nothing |
|
|
|
stanzaErrorConditionFromText "registration-required" = Just RegistrationRequired |
|
|
|
stanzaErrorConditionFromText "registration-required" = RegistrationRequired |
|
|
|
stanzaErrorConditionFromText "remote-server-not-found" = Just RemoteServerNotFound |
|
|
|
stanzaErrorConditionFromText "remote-server-not-found" = RemoteServerNotFound |
|
|
|
stanzaErrorConditionFromText "remote-server-timeout" = Just RemoteServerTimeout |
|
|
|
stanzaErrorConditionFromText "remote-server-timeout" = RemoteServerTimeout |
|
|
|
stanzaErrorConditionFromText "resource-constraint" = Just ResourceConstraint |
|
|
|
stanzaErrorConditionFromText "resource-constraint" = ResourceConstraint |
|
|
|
stanzaErrorConditionFromText "service-unavailable" = Just ServiceUnavailable |
|
|
|
stanzaErrorConditionFromText "service-unavailable" = ServiceUnavailable |
|
|
|
stanzaErrorConditionFromText "subscription-required" = Just SubscriptionRequired |
|
|
|
stanzaErrorConditionFromText "subscription-required" = SubscriptionRequired |
|
|
|
stanzaErrorConditionFromText "undefined-condition" = Just UndefinedCondition |
|
|
|
stanzaErrorConditionFromText "undefined-condition" = UndefinedCondition |
|
|
|
stanzaErrorConditionFromText "unexpected-request" = Just UnexpectedRequest |
|
|
|
stanzaErrorConditionFromText "unexpected-request" = UnexpectedRequest |
|
|
|
stanzaErrorConditionFromText _ = Nothing |
|
|
|
stanzaErrorConditionFromText _ = UndefinedCondition |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -218,7 +216,7 @@ xpStanzaError = ("xpStanzaError" , "") <?+> xpWrap |
|
|
|
(xpAttribute' "code" xpId)) |
|
|
|
(xpAttribute' "code" xpId)) |
|
|
|
(xp3Tuple |
|
|
|
(xp3Tuple |
|
|
|
xpStanzaErrorCondition |
|
|
|
xpStanzaErrorCondition |
|
|
|
(xpOption $ xpElem "{jabber:client}text" |
|
|
|
(xpOption $ xpElem "{urn:ietf:params:xml:ns:xmpp-stanzas}text" |
|
|
|
(xpAttrImplied xmlLang xpLang) |
|
|
|
(xpAttrImplied xmlLang xpLang) |
|
|
|
(xpContent xpNonemptyText) |
|
|
|
(xpContent xpNonemptyText) |
|
|
|
) |
|
|
|
) |
|
|
|
@ -463,9 +461,7 @@ xpStanzaErrorType = ("xpStanzaErrorType", "") <?> |
|
|
|
|
|
|
|
|
|
|
|
xpStreamErrorCondition :: PU Text StreamErrorCondition |
|
|
|
xpStreamErrorCondition :: PU Text StreamErrorCondition |
|
|
|
xpStreamErrorCondition = ("xpStreamErrorCondition", "") <?> |
|
|
|
xpStreamErrorCondition = ("xpStreamErrorCondition", "") <?> |
|
|
|
xpPartial ( \input -> case streamErrorConditionFromText input of |
|
|
|
xpIso streamErrorConditionFromText |
|
|
|
Nothing -> Left "Could not parse stream error condition." |
|
|
|
|
|
|
|
Just j -> Right j) |
|
|
|
|
|
|
|
streamErrorConditionToText |
|
|
|
streamErrorConditionToText |
|
|
|
where |
|
|
|
where |
|
|
|
streamErrorConditionToText StreamBadFormat = "bad-format" |
|
|
|
streamErrorConditionToText StreamBadFormat = "bad-format" |
|
|
|
@ -493,29 +489,29 @@ xpStreamErrorCondition = ("xpStreamErrorCondition", "") <?> |
|
|
|
streamErrorConditionToText StreamUnsupportedFeature = "unsupported-feature" |
|
|
|
streamErrorConditionToText StreamUnsupportedFeature = "unsupported-feature" |
|
|
|
streamErrorConditionToText StreamUnsupportedStanzaType = "unsupported-stanza-type" |
|
|
|
streamErrorConditionToText StreamUnsupportedStanzaType = "unsupported-stanza-type" |
|
|
|
streamErrorConditionToText StreamUnsupportedVersion = "unsupported-version" |
|
|
|
streamErrorConditionToText StreamUnsupportedVersion = "unsupported-version" |
|
|
|
streamErrorConditionFromText "bad-format" = Just StreamBadFormat |
|
|
|
streamErrorConditionFromText "bad-format" = StreamBadFormat |
|
|
|
streamErrorConditionFromText "bad-namespace-prefix" = Just StreamBadNamespacePrefix |
|
|
|
streamErrorConditionFromText "bad-namespace-prefix" = StreamBadNamespacePrefix |
|
|
|
streamErrorConditionFromText "conflict" = Just StreamConflict |
|
|
|
streamErrorConditionFromText "conflict" = StreamConflict |
|
|
|
streamErrorConditionFromText "connection-timeout" = Just StreamConnectionTimeout |
|
|
|
streamErrorConditionFromText "connection-timeout" = StreamConnectionTimeout |
|
|
|
streamErrorConditionFromText "host-gone" = Just StreamHostGone |
|
|
|
streamErrorConditionFromText "host-gone" = StreamHostGone |
|
|
|
streamErrorConditionFromText "host-unknown" = Just StreamHostUnknown |
|
|
|
streamErrorConditionFromText "host-unknown" = StreamHostUnknown |
|
|
|
streamErrorConditionFromText "improper-addressing" = Just StreamImproperAddressing |
|
|
|
streamErrorConditionFromText "improper-addressing" = StreamImproperAddressing |
|
|
|
streamErrorConditionFromText "internal-server-error" = Just StreamInternalServerError |
|
|
|
streamErrorConditionFromText "internal-server-error" = StreamInternalServerError |
|
|
|
streamErrorConditionFromText "invalid-from" = Just StreamInvalidFrom |
|
|
|
streamErrorConditionFromText "invalid-from" = StreamInvalidFrom |
|
|
|
streamErrorConditionFromText "invalid-namespace" = Just StreamInvalidNamespace |
|
|
|
streamErrorConditionFromText "invalid-namespace" = StreamInvalidNamespace |
|
|
|
streamErrorConditionFromText "invalid-xml" = Just StreamInvalidXml |
|
|
|
streamErrorConditionFromText "invalid-xml" = StreamInvalidXml |
|
|
|
streamErrorConditionFromText "not-authorized" = Just StreamNotAuthorized |
|
|
|
streamErrorConditionFromText "not-authorized" = StreamNotAuthorized |
|
|
|
streamErrorConditionFromText "not-well-formed" = Just StreamNotWellFormed |
|
|
|
streamErrorConditionFromText "not-well-formed" = StreamNotWellFormed |
|
|
|
streamErrorConditionFromText "policy-violation" = Just StreamPolicyViolation |
|
|
|
streamErrorConditionFromText "policy-violation" = StreamPolicyViolation |
|
|
|
streamErrorConditionFromText "remote-connection-failed" = Just StreamRemoteConnectionFailed |
|
|
|
streamErrorConditionFromText "remote-connection-failed" = StreamRemoteConnectionFailed |
|
|
|
streamErrorConditionFromText "reset" = Just StreamReset |
|
|
|
streamErrorConditionFromText "reset" = StreamReset |
|
|
|
streamErrorConditionFromText "resource-constraint" = Just StreamResourceConstraint |
|
|
|
streamErrorConditionFromText "resource-constraint" = StreamResourceConstraint |
|
|
|
streamErrorConditionFromText "restricted-xml" = Just StreamRestrictedXml |
|
|
|
streamErrorConditionFromText "restricted-xml" = StreamRestrictedXml |
|
|
|
streamErrorConditionFromText "see-other-host" = Just StreamSeeOtherHost |
|
|
|
streamErrorConditionFromText "see-other-host" = StreamSeeOtherHost |
|
|
|
streamErrorConditionFromText "system-shutdown" = Just StreamSystemShutdown |
|
|
|
streamErrorConditionFromText "system-shutdown" = StreamSystemShutdown |
|
|
|
streamErrorConditionFromText "undefined-condition" = Just StreamUndefinedCondition |
|
|
|
streamErrorConditionFromText "undefined-condition" = StreamUndefinedCondition |
|
|
|
streamErrorConditionFromText "unsupported-encoding" = Just StreamUnsupportedEncoding |
|
|
|
streamErrorConditionFromText "unsupported-encoding" = StreamUnsupportedEncoding |
|
|
|
streamErrorConditionFromText "unsupported-feature" = Just StreamUnsupportedFeature |
|
|
|
streamErrorConditionFromText "unsupported-feature" = StreamUnsupportedFeature |
|
|
|
streamErrorConditionFromText "unsupported-stanza-type" = Just StreamUnsupportedStanzaType |
|
|
|
streamErrorConditionFromText "unsupported-stanza-type" = StreamUnsupportedStanzaType |
|
|
|
streamErrorConditionFromText "unsupported-version" = Just StreamUnsupportedVersion |
|
|
|
streamErrorConditionFromText "unsupported-version" = StreamUnsupportedVersion |
|
|
|
streamErrorConditionFromText _ = Nothing |
|
|
|
streamErrorConditionFromText _ = StreamUndefinedCondition -- §4.9.2 |
|
|
|
|