aboutsummaryrefslogtreecommitdiffstats
path: root/util/xmppstream.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-09-30 09:50:33 +0100
committerMatthew Wild <mwild1@gmail.com>2020-09-30 09:50:33 +0100
commit785c20f6ee7e61a5a91a8b6259623bc2a2bbffaa (patch)
tree3a37db7b805b1555d08cc61c7938cf512ff35ce0 /util/xmppstream.lua
parente55d037cdf89efac99c6144b381c9fa880f7fb93 (diff)
parentb80ff2ae4f86aa26e055890a8284b55170ef2056 (diff)
downloadprosody-785c20f6ee7e61a5a91a8b6259623bc2a2bbffaa.tar.gz
prosody-785c20f6ee7e61a5a91a8b6259623bc2a2bbffaa.zip
Merge 0.11->trunk
Diffstat (limited to 'util/xmppstream.lua')
-rw-r--r--util/xmppstream.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/xmppstream.lua b/util/xmppstream.lua
index 58cbd18e..6aa1def3 100644
--- a/util/xmppstream.lua
+++ b/util/xmppstream.lua
@@ -64,6 +64,8 @@ local function new_sax_handlers(session, stream_callbacks, cb_handleprogress)
local stream_default_ns = stream_callbacks.default_ns;
+ local stream_lang = "en";
+
local stack = {};
local chardata, stanza = {};
local stanza_size = 0;
@@ -101,6 +103,7 @@ local function new_sax_handlers(session, stream_callbacks, cb_handleprogress)
if session.notopen then
if tagname == stream_tag then
non_streamns_depth = 0;
+ stream_lang = attr["xml:lang"] or stream_lang;
if cb_streamopened then
if lxp_supports_bytecount then
cb_handleprogress(stanza_size);
@@ -178,6 +181,9 @@ local function new_sax_handlers(session, stream_callbacks, cb_handleprogress)
cb_handleprogress(stanza_size);
end
stanza_size = 0;
+ if stanza.attr["xml:lang"] == nil then
+ stanza.attr["xml:lang"] = stream_lang;
+ end
if tagname ~= stream_error_tag then
cb_handlestanza(session, stanza);
else