aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_scansion_record.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_scansion_record.lua')
-rw-r--r--plugins/mod_scansion_record.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_scansion_record.lua b/plugins/mod_scansion_record.lua
index 8d772b4e..6d57c209 100644
--- a/plugins/mod_scansion_record.lua
+++ b/plugins/mod_scansion_record.lua
@@ -18,10 +18,12 @@ local scan = io.open(record_file, "w+");
local function record(string)
scan:write(string);
+ scan:flush();
end
local function record_header(string)
head:write(string);
+ head:flush();
end
local function record_object(class, name, props)
@@ -30,6 +32,7 @@ local function record_object(class, name, props)
head:write(("\t%s: %s\n"):format(k, v));
end
head:write("\n");
+ head:flush();
end
local function record_event(session, event)
@@ -37,8 +40,7 @@ local function record_event(session, event)
end
local function record_stanza(stanza, session, verb)
- local flattened = tostring(stanza):gsub("><", ">\n\t<");
- -- TODO Proper prettyprinting with indentation
+ local flattened = tostring(stanza:indent(2, "\t"));
record(session.scansion_id.." "..verb..":\n\t"..flattened.."\n\n");
end