# HG changeset patch # User Kim Alvefur # Date 1590746644 -7200 # Node ID 270cd50852be095e9db46ec1043e095d19d0874e # Parent a359972d246edbacdd2557075828daf18c62c922 mod_rest: Map xml:lang to/from JSON diff -r a359972d246e -r 270cd50852be mod_rest/jsonmap.lib.lua --- a/mod_rest/jsonmap.lib.lua Tue May 26 21:32:55 2020 +0200 +++ b/mod_rest/jsonmap.lib.lua Fri May 29 12:04:04 2020 +0200 @@ -13,6 +13,7 @@ to = "attr", from = "attr", id = "attr", + lang = "attr", -- basic message body = "text_tag", @@ -444,6 +445,7 @@ to = s.attr.to, from = s.attr.from, id = s.attr.id, + lang = s.attr["xml:lang"], }; if s.name == "presence" and not s.attr.type then t.type = "available"; @@ -538,6 +540,7 @@ to = str(t.to) and jid.prep(t.to); from = str(t.to) and jid.prep(t.from); id = str(t.id), + ["xml:lang"] = str(t.lang), }); if t.to and not s.attr.to then