diff options
author | Kim Alvefur <zash@zash.se> | 2018-09-22 18:32:22 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-09-22 18:32:22 +0200 |
commit | 18537a7bceae249e824a245025f493f62ae3b6b2 (patch) | |
tree | f75ad63779c9e7d56aa5c24d0b66fcf65132783e | |
parent | 71a7d72763473c19426f971465d6568007cca261 (diff) | |
download | prosody-18537a7bceae249e824a245025f493f62ae3b6b2.tar.gz prosody-18537a7bceae249e824a245025f493f62ae3b6b2.zip |
mod_scansion_record: Record connected clients as scansion Objects declarations
-rw-r--r-- | plugins/mod_scansion_record.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/mod_scansion_record.lua b/plugins/mod_scansion_record.lua index 0ee22778..defbbee4 100644 --- a/plugins/mod_scansion_record.lua +++ b/plugins/mod_scansion_record.lua @@ -23,6 +23,14 @@ local function record_header(string) head:write(string); end +local function record_object(class, name, props) + head:write(("[%s] %s\n"):format(class, name)); + for k,v in pairs(props) do + head:write(("\t%s: %s\n"):format(k, v)); + end + head:write("\n"); +end + local function record_event(session, event) record(session.scansion_id.." "..event.."\n\n"); end @@ -67,6 +75,11 @@ module:hook("resource-bind", function (event) session.scansion_device = device; session.scansion_id = user.character..(device ~= "" and "'s "..device or device); + record_object("Client", user.character, { + jid = session.full_jid, + password = "password", + }); + module:log("warn", "Connected: %s's %s", user.character, device); record_event(session, "connects"); |