Skip to content
Permalink
Browse files

Fix JXT mappings for stream errors.

  • Loading branch information...
legastero committed Aug 1, 2019
1 parent 4c94adf commit 4142e46e9bfed14be9cea674826a7aa6331d0396
@@ -8,7 +8,7 @@
| -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------ | -------------------------------------------- |
| [RFC 7395](https://tools.ietf.org/html/rfc7395) | An Extensible Messaging and Presence Protocol (XMPP) Subprotocol for WebSocket | [Source](../src/protocol/rfc7395.ts) | |
| [RFC 6121](https://tools.ietf.org/html/rfc6121) | Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence | [Source](../src/protocol/rfc6121.ts) | [Test Cases](../test/protocol-cases/rfc6121) |
| [RFC 6120](https://tools.ietf.org/html/rfc6120) | Extensible Messaging and Presence Protocol (XMPP): Core | [Source](../src/protocol/rfc6120.ts) | |
| [RFC 6120](https://tools.ietf.org/html/rfc6120) | Extensible Messaging and Presence Protocol (XMPP): Core | [Source](../src/protocol/rfc6120.ts) | [Test Cases](../test/protocol-cases/rfc6120) |
| [RFC 3921](https://tools.ietf.org/html/rfc3921) | Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence | [Source](../src/protocol/rfc3921.ts) | |
| [draft-cridland-xmpp-session-01](https://tools.ietf.org/html/draft-cridland-xmpp-session-01) | Here Lies Extensible Messaging and Presence Protocol (XMPP) Session Establishment | [Source](../src/protocol/rfc3921.ts) | |
| [XRD](http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html) | Extensible Resource Descriptor (XRD) | [Source](../src/protocol/xrd.ts) | [Test Cases](../test/protocol-cases/xrd) |
@@ -28,7 +28,15 @@ import {
multipleChildText,
textBuffer
} from '../jxt';
import { NS_BIND, NS_CLIENT, NS_SASL, NS_STANZAS, NS_STARTTLS, NS_STREAM } from '../Namespaces';
import {
NS_BIND,
NS_CLIENT,
NS_SASL,
NS_STANZAS,
NS_STARTTLS,
NS_STREAM,
NS_STREAMS
} from '../Namespaces';

import { IQ } from './';

@@ -189,14 +197,14 @@ const _StreamFeatures: DefinitionOptions = {
const _StreamError: DefinitionOptions = {
element: 'error',
fields: {
alternateLanguageText: childAlternateLanguageText(NS_STANZAS, 'text'),
alternateLanguageText: childAlternateLanguageText(NS_STREAMS, 'text'),
condition: childEnum(
NS_STREAM,
NS_STREAMS,
toList(StreamErrorCondition),
StreamErrorCondition.UndefinedCondition
),
seeOtherHost: childText(NS_STREAM, StreamErrorCondition.SeeOtherHost),
text: childText(NS_STANZAS, 'text')
seeOtherHost: childText(NS_STREAMS, StreamErrorCondition.SeeOtherHost),
text: childText(NS_STREAMS, 'text')
},
namespace: NS_STREAM,
path: 'streamError'
@@ -0,0 +1,7 @@
[
"streamError",
{
"condition": "see-other-host",
"seeOtherHost": "[2001:41D0:1:A49b::1]:9222"
}
]
@@ -0,0 +1,3 @@
<error xmlns="http://etherx.jabber.org/streams">
<see-other-host xmlns="urn:ietf:params:xml:ns:xmpp-streams">[2001:41D0:1:A49b::1]:9222</see-other-host>
</error>
@@ -0,0 +1,14 @@
[
"streamError",
{
"condition": "not-well-formed",
"text": "Some special application diagnostic information!"
},
{
"alternateLanguageText": [
{ "lang": "", "value": "Some special application diagnostic information!" }
],
"condition": "not-well-formed",
"text": "Some special application diagnostic information!"
}
]
@@ -0,0 +1,4 @@
<error xmlns="http://etherx.jabber.org/streams">
<not-well-formed xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-streams">Some special application diagnostic information!</text>
</error>

0 comments on commit 4142e46

Please sign in to comment.
You can’t perform that action at this time.