aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-11-12 18:26:39 +0100
committerKim Alvefur <zash@zash.se>2018-11-12 18:26:39 +0100
commit2048b8d48204bb1e8c85ccc33916d98337a28fc0 (patch)
tree332a203aed3ac84773cfec787d62620213227cf5 /plugins
parent928d5d54ec1cf5f7d785985ebffdc72a1c5a09b3 (diff)
parentcdf083b8d48516ae3c0e2f25da92eb9479b19012 (diff)
downloadprosody-2048b8d48204bb1e8c85ccc33916d98337a28fc0.tar.gz
prosody-2048b8d48204bb1e8c85ccc33916d98337a28fc0.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_scansion_record.lua15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/mod_scansion_record.lua b/plugins/mod_scansion_record.lua
index 3fbc8b6b..8d772b4e 100644
--- a/plugins/mod_scansion_record.lua
+++ b/plugins/mod_scansion_record.lua
@@ -6,6 +6,7 @@ local filters = require "util.filters";
local id = require "util.id";
local dt = require "util.datetime";
local dm = require "util.datamanager";
+local st = require "util.stanza";
local record_id = id.medium():lower();
local record_date = os.date("%Y%b%d"):lower();
@@ -36,12 +37,16 @@ local function record_event(session, event)
end
local function record_stanza(stanza, session, verb)
- record(session.scansion_id.." "..verb..":\n\t"..tostring(stanza).."\n\n");
+ local flattened = tostring(stanza):gsub("><", ">\n\t<");
+ -- TODO Proper prettyprinting with indentation
+ record(session.scansion_id.." "..verb..":\n\t"..flattened.."\n\n");
end
local function record_stanza_in(stanza, session)
if stanza.attr.xmlns == nil then
- record_stanza(stanza, session, "sends")
+ local copy = st.clone(stanza);
+ copy.attr.from = nil;
+ record_stanza(copy, session, "sends")
end
return stanza;
end
@@ -49,7 +54,11 @@ end
local function record_stanza_out(stanza, session)
if stanza.attr.xmlns == nil then
if not (stanza.name == "iq" and stanza:get_child("bind", "urn:ietf:params:xml:ns:xmpp-bind")) then
- record_stanza(stanza, session, "receives");
+ local copy = st.clone(stanza);
+ if copy.attr.to == session.full_jid then
+ copy.attr.to = nil;
+ end
+ record_stanza(copy, session, "receives");
end
end
return stanza;