diff options
author | Kim Alvefur <zash@zash.se> | 2018-09-22 14:36:34 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-09-22 14:36:34 +0200 |
commit | 39c33737f0af2b8be3610077a5e06a5281928ecb (patch) | |
tree | 5a19219b92877c8c6e2bfb23f0da2af2c681177e /plugins | |
parent | dd75571eab7ae592361f6343bcddfe6c8e07a20c (diff) | |
download | prosody-39c33737f0af2b8be3610077a5e06a5281928ecb.tar.gz prosody-39c33737f0af2b8be3610077a5e06a5281928ecb.zip |
mod_scansion_record: Open a related file for header entries
Since It's tricky to go back and insert data at the beginning of a file,
but `cat blah.sch blah.scs` ought to be fine for now.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_scansion_record.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_scansion_record.lua b/plugins/mod_scansion_record.lua index e7fa8e70..6e93aead 100644 --- a/plugins/mod_scansion_record.lua +++ b/plugins/mod_scansion_record.lua @@ -10,14 +10,20 @@ local dm = require "util.datamanager"; local record_id = id.medium():lower(); local record_date = os.date("%Y%b%d"):lower(); +local header_file = dm.getpath(record_id, "scansion", record_date, "sch", true); local record_file = dm.getpath(record_id, "scansion", record_date, "scs", true); +local head = io.open(header_file, "w"); local scan = io.open(record_file, "w"); local function record(string) scan:write(string); end +local function record_header(string) + head:write(string); +end + local function record_event(session, event) record(session.scansion_id.." "..event.."\n\n"); end @@ -74,4 +80,5 @@ end); module:hook_global("server-stopping", function () module:log("info", "Scansion recording available in %s", record_file); scan:close(); + head:close() end); |