On 14 August 2014 18:12, Kurt Zeilenga <[email protected]> wrote:
> While XEP 298 does say: > > 1. > > The namespace of the forwarded stanza MUST be preserved (this is > typically 'jabber:client'). If no 'xmlns' is set for the stanza then as per > XML namespacing rules it would inherit the 'urn:xmpp:forward:0' namespace, > which is wrong. > > This, by itself, is insufficient to ensure all relevant namespaces of the > original stanza are preserved. Any namespaces of the stream which the > original message was received on, as well those of the original stanza need > to preserved if used in the original stanza, need to preserved. Also, > lang tags should preserved. > > I agree that we need to ensure that all relevant namespaces are preserved. I'm in general agreement about xml:lang, but I'd note that servers should really be preserving this on routing anyway, and don't. > One way to do this is for the forwarded to copy all the name space > declarations of the stream the original message was received into the > forward element, use a prefix for the 'urn:xmpp:forward:0' which doesn't > clash, and copy all prefixes of the original message with the original > message, using the same prefixes as on the stream it was received on. > This seems rather ham-handed, and also restricted to implementations which are aware of the prefixes used, and the namespaces declared. I also don't think it's ever needed. > > So, for instance, if one received: > > <stream:stream > from='[email protected]' > to='im.example.com' > version='1.0' > xml:lang='en' > xmlns='jabber:client' > xmlns:stream='http://etherx.jabber.org/streams'> > <message> > <body>foo</body> > </message> > </stream:stream> > > > > The element to be forwarded (inside a suitable message element) would be: > > <forwarded:forwarded xmlns:forwarded='urn:xmpp:forward:0 > xml:lang='en' > > xmlns='jabber:client' > xmlns:stream='http://etherx.jabber.org/streams'> > > <message> > <body>foo</body> > </message> > > </forwarded:forwarded> > > Including the stream namespace here seems of no value. If an implementation has declared other namespaces at the stream level - and I vaguely recall some Blackberry client doing this - then the client is wrong - RFC 6120 $4.8.5, last paragraph. > Or if one received: > > <stream > from='[email protected]' > to='im.example.com' > version='1.0' > xml:lang='en' > xmlns='http://etherx.jabber.org/streams'> > <message xmlns='jabber:client'> > <body>foo</body> > </message> > </stream> > > > <forwarded:forwarded xmlns:forwarded='urn:xmpp:forward:0'xml:lang='en' > > xml:lang='en' > > xmlns='http://etherx.jabber.org/streams'> > > <message xmlns='jabber:client'> > <body>foo</body> > </message> > > </forwarded:forwarded> > > > No, the content namespace MUST be without prefix, and MUST be declared as such in the stream header, so this is invalid too. Dave.
