comparison plugins/mod_scansion_record.lua @ 11120:b2331f3dfeea

Merge 0.11->trunk
author Matthew Wild <mwild1@gmail.com>
date Wed, 30 Sep 2020 09:50:33 +0100
parents d229e4d31598
children 613035d6e5a0
comparison
equal deleted inserted replaced
11119:68df52bf08d5 11120:b2331f3dfeea
35 local function record_event(session, event) 35 local function record_event(session, event)
36 record(session.scansion_id.." "..event.."\n\n"); 36 record(session.scansion_id.." "..event.."\n\n");
37 end 37 end
38 38
39 local function record_stanza(stanza, session, verb) 39 local function record_stanza(stanza, session, verb)
40 local flattened = tostring(stanza):gsub("><", ">\n\t<"); 40 local flattened = tostring(stanza:indent(2, "\t"));
41 -- TODO Proper prettyprinting with indentation
42 record(session.scansion_id.." "..verb..":\n\t"..flattened.."\n\n"); 41 record(session.scansion_id.." "..verb..":\n\t"..flattened.."\n\n");
43 end 42 end
44 43
45 local function record_stanza_in(stanza, session) 44 local function record_stanza_in(stanza, session)
46 if stanza.attr.xmlns == nil then 45 if stanza.attr.xmlns == nil then