mirror of
https://github.com/processone/ejabberd.git
synced 2024-07-06 23:22:36 +02:00
Process "xmlns:xmpp" and "xmlns:stream" correctly (thanks to Pawel)
This commit is contained in:
parent
32e0a88edc
commit
21c75ebce5
|
@ -746,6 +746,7 @@ make_xmlstreamstart(XMPPDomain, Version) ->
|
||||||
{xmlstreamstart, "stream:stream",
|
{xmlstreamstart, "stream:stream",
|
||||||
[{"to", XMPPDomain},
|
[{"to", XMPPDomain},
|
||||||
{"xmlns", ?NS_CLIENT},
|
{"xmlns", ?NS_CLIENT},
|
||||||
|
{"xmlns:xmpp", ?NS_BOSH},
|
||||||
{"xmlns:stream", ?NS_STREAM}|VersionEl]}.
|
{"xmlns:stream", ?NS_STREAM}|VersionEl]}.
|
||||||
|
|
||||||
maybe_add_xmlstreamend(Els, "terminate") ->
|
maybe_add_xmlstreamend(Els, "terminate") ->
|
||||||
|
@ -778,7 +779,10 @@ encode_body(#body{attrs = Attrs, els = Els}) ->
|
||||||
{"condition", "remote-stream-error"},
|
{"condition", "remote-stream-error"},
|
||||||
{"xmlns:stream", ?NS_STREAM}|AttrsAcc],
|
{"xmlns:stream", ?NS_STREAM}|AttrsAcc],
|
||||||
[xml:element_to_binary(El)|XMLBuf]};
|
[xml:element_to_binary(El)|XMLBuf]};
|
||||||
({xmlstreamelement, El}, {AttrsAcc, XMLBuf}) ->
|
({xmlstreamelement, {xmlelement, "stream:features", _, _} = El}, {AttrsAcc, XMLBuf}) ->
|
||||||
|
{lists:keystore("xmlns:stream", 1, AttrsAcc, {"xmlns:stream", ?NS_STREAM}),
|
||||||
|
[xml:element_to_binary(El)|XMLBuf]};
|
||||||
|
({xmlstreamelement, El}, {AttrsAcc, XMLBuf}) ->
|
||||||
{AttrsAcc, [xml:element_to_binary(El)|XMLBuf]};
|
{AttrsAcc, [xml:element_to_binary(El)|XMLBuf]};
|
||||||
({xmlstreamend, _}, {AttrsAcc, XMLBuf}) ->
|
({xmlstreamend, _}, {AttrsAcc, XMLBuf}) ->
|
||||||
{[{"type", "terminate"},
|
{[{"type", "terminate"},
|
||||||
|
@ -789,8 +793,9 @@ encode_body(#body{attrs = Attrs, els = Els}) ->
|
||||||
"" ->
|
"" ->
|
||||||
[{"authid", StreamID}|AttrsAcc];
|
[{"authid", StreamID}|AttrsAcc];
|
||||||
V ->
|
V ->
|
||||||
[{"xmpp:version", V},
|
lists:keystore("xmlns:xmpp", 1, [{"xmpp:version", V},
|
||||||
{"authid", StreamID} | AttrsAcc]
|
{"authid", StreamID} | AttrsAcc],
|
||||||
|
{"xmlns:xmpp", ?NS_BOSH})
|
||||||
end,
|
end,
|
||||||
{NewAttrs, XMLBuf};
|
{NewAttrs, XMLBuf};
|
||||||
({xmlstreamerror, _}, {AttrsAcc, XMLBuf}) ->
|
({xmlstreamerror, _}, {AttrsAcc, XMLBuf}) ->
|
||||||
|
|
Loading…
Reference in New Issue
Block a user